MoveWorker moves all the tasks in one queue to another queue
Usage
No installation is required, the container can be run directly. To move all tasks from queue1 to queue2 if your gearman server is gearman.example.com:
docker run -it --rm --network ivnet intelligentvoice.azurecr.io/gearman-iv-move-worker gearman.example.com --source_queue queue1 --target_queue queue2
You can also optionally delete all tasks from a queue by passing a --delete parameter.
To delete all tasks from queue1 if your gearman server is gearman.example.com:
docker run -it --rm --network ivnet intelligentvoice.azurecr.io/gearman-iv-move-worker gearman.example.com --source_queue queue1 --delete
Configuration
All configuration options can be set on the command line.
Parameters
There is one parameter which can be added to the end of the command:
--sleep_secs Number of seconds to sleep between move operations (default 1)
Environment variables
There are four environment variables which can be set by adding env NAME=VALUE
to the command after docker run -it
.
Environment variable | default | values | description |
---|---|---|---|
LOGGING_LEVEL | INFO | DEBUG, INFO, WARN, ERROR, CRITICAL | level for python logging module - at INFO level prints one line for each task moved |
CUTOFF_TIME_INTERVAL | 0 | int | If the job.data contains last_check_time, wait this many seconds before moving |
MAX_REQUEUE_COUNT | 10 | int | Jobs that are moved after their requeue_count exceeds this are classed as reset, and will have their requeue_count, last_check_time and exception fields cleared |
WORKER_COUNT | 1 | int | number of workers to run in parallel |