Worker
worker_state_verification
Perform cli commands verification (state checking).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ctx |
Context
|
Typer (Click like) special internal object that holds state relevant for the script execution at every single level. |
required |
Source code in src/trecover/app/cli/worker.py
worker_start
worker_start(
name=Option(
"TRecoverWorker",
"--name",
"-n",
help="Set custom worker hostname.",
),
pool=Option(
var.PoolType.solo,
"--pool",
"-p",
help="Worker processes/threads pool type.",
),
loglevel=Option(
var.LogLevel.info,
"--loglevel",
"-l",
help="Logging level.",
),
concurrency=Option(
var.CELERY_WORKERS,
"-c",
help="The number of worker processes.",
),
broker_url=Option(
var.CELERY_BROKER, "--broker", help="Broker url."
),
backend_url=Option(
var.CELERY_BACKEND, "--backend", help="Backend url."
),
attach=Option(
False,
"--attach",
"-a",
is_flag=True,
help="Attach output and error streams",
),
no_daemon=Option(
False,
"--no-daemon",
is_flag=True,
help="Do not run as a daemon process",
),
)
Start API service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str, default
|
Custom worker hostname. |
Option('TRecoverWorker', '--name', '-n', help='Set custom worker hostname.')
|
pool |
str
|
Worker processes/threads pool type. |
Option(var.PoolType.solo, '--pool', '-p', help='Worker processes/threads pool type.')
|
loglevel |
var.LogLevel
|
Level of logging. |
'debug'
|
concurrency |
int, default
|
The number of worker processes. |
Option(var.CELERY_WORKERS, '-c', help='The number of worker processes.')
|
broker_url |
str, default
|
Broker url. |
Option(var.CELERY_BROKER, '--broker', help='Broker url.')
|
backend_url |
str, default
|
Backend url. |
Option(var.CELERY_BACKEND, '--backend', help='Backend url.')
|
attach |
bool, default
|
Attach output and error streams. |
Option(False, '--attach', '-a', is_flag=True, help='Attach output and error streams')
|
no_daemon |
bool, default
|
Do not run as a daemon process. |
Option(False, '--no-daemon', is_flag=True, help='Do not run as a daemon process')
|
Raises:
Type | Description |
---|---|
typer.BadParameter:
|
If non-solo pool type is selected for windows platform. |
Source code in src/trecover/app/cli/worker.py
worker_stop
Stop worker service.
Source code in src/trecover/app/cli/worker.py
worker_status
Display worker service status.
worker_attach
worker_attach(
live=Option(
False,
"--live",
"-l",
is_flag=True,
help="Stream only fresh log records",
)
)
Attach local output stream to a running worker service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
live |
bool, Default
|
Stream only fresh log records. |
Option(False, '--live', '-l', is_flag=True, help='Stream only fresh log records')
|