Maybe a --queue all or something?
+1
Working in the area and this seems trivial with bug 31124 addition.
Created attachment 182708 [details] [review] Bug 32736: Add --all-queues switch to koha-worker This patch adds a convenient option switch to the script. It will make it perform the action (start, stop, restart, print status) on all defined queues ('default' and 'long_tasks', as of today). To test, make sure you applied bug 31124: 0. Apply this patch 1. Run: $ ktd --shell --root k$ cp debian/scripts/koha-functions.sh \ /usr/share/koha/bin/koha-functions.sh 2. Play with all the options for: k$ debian/scripts/koha-worker * kohadev => SUCCESS: All options work as expected! Note: you should include (say) having `long_tasks` stopped, and starting all workers with the new parameter. And the same for `--stop` and `--start`. 3. Sign off :-D
Created attachment 182710 [details] [review] Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues
Sorry: $ git bz apply 32736 Bug 32736 Depends on bug 31124 (Signed Off) Follow? [(y)es, (n)o] y Bug 31124 - koha-remove fails to remove long_tasks queue daemon, so koha-create for same <instance> user fails 182714 - Bug 31124: Make koha-remove stop all workers Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 31124: Make koha-remove stop all workers Bug 32736 - koha-worker should be able to restart all queues with a single call 182708 - Bug 32736: Add --all-queues switch to koha-worker 182710 - Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 32736: Add --all-queues switch to koha-worker Applying: Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues error: sha1 information is lacking or useless (debian/scripts/koha-create). error: could not build fake ancestor Patch failed at 0001 Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-32736-follow-up-Make-scripts-using-koha-worker-NyF0sC.patch
Created attachment 185252 [details] [review] Bug 32736: Add --all-queues switch to koha-worker This patch adds a convenient option switch to the script. It will make it perform the action (start, stop, restart, print status) on all defined queues ('default' and 'long_tasks', as of today). To test, make sure you applied bug 31124: 0. Apply this patch 1. Run: $ ktd --shell --root k$ cp debian/scripts/koha-functions.sh \ /usr/share/koha/bin/koha-functions.sh 2. Play with all the options for: k$ debian/scripts/koha-worker * kohadev => SUCCESS: All options work as expected! Note: you should include (say) having `long_tasks` stopped, and starting all workers with the new parameter. And the same for `--stop` and `--start`. 3. Sign off :-D
Created attachment 185253 [details] [review] Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues
The patch no longer applies 8-(... git bz apply 32736 Bug 32736 - koha-worker should be able to restart all queues with a single call 185252 - Bug 32736: Add --all-queues switch to koha-worker 185253 - Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 32736: Add --all-queues switch to koha-worker Using index info to reconstruct a base tree... M debian/scripts/koha-worker Falling back to patching base and 3-way merge... Auto-merging debian/scripts/koha-worker CONFLICT (content): Merge conflict in debian/scripts/koha-worker error: Failed to merge in the changes. Patch failed at 0001 Bug 32736: Add --all-queues switch to koha-worker
Created attachment 190736 [details] [review] Bug 32736: Add --all-queues switch to koha-worker This patch adds a convenient option switch to the script. It will make it perform the action (start, stop, restart, print status) on all defined queues ('default' and 'long_tasks', as of today). To test, make sure you applied bug 31124: 0. Apply this patch 1. Run: $ ktd --shell --root k$ cp debian/scripts/koha-functions.sh \ /usr/share/koha/bin/koha-functions.sh 2. Play with all the options for: k$ debian/scripts/koha-worker * kohadev => SUCCESS: All options work as expected! Note: you should include (say) having `long_tasks` stopped, and starting all workers with the new parameter. And the same for `--stop` and `--start`. 3. Sign off :-D
Created attachment 190737 [details] [review] Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues Patch from commit cad1ee2
Created attachment 190738 [details] [review] Bug 32736: Add --all-queues switch to koha-worker This patch adds a convenient option switch to the script. It will make it perform the action (start, stop, restart, print status) on all defined queues ('default' and 'long_tasks', as of today). To test, make sure you applied bug 31124: 0. Apply this patch 1. Run: $ ktd --shell --root k$ cp debian/scripts/koha-functions.sh \ /usr/share/koha/bin/koha-functions.sh 2. Play with all the options for: k$ debian/scripts/koha-worker * kohadev => SUCCESS: All options work as expected! Note: you should include (say) having `long_tasks` stopped, and starting all workers with the new parameter. And the same for `--stop` and `--start`. 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com>
Created attachment 190739 [details] [review] Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. After applying the patch, I ran reset_all 2. Running koha-worker --help now shows the new options 3. I tested some of the options, and they all seemed to work okay for me: - sudo koha-worker --stop --all-queues kohadev - sudo koha-worker --status kohadev - sudo koha-worker --status --all-queues kohadev - sudo koha-worker --start --queue default kohadev - sudo koha-worker --status --all-queues kohadev - sudo koha-worker --start --all-queues kohadev - sudo koha-worker --start --all-queues kohadev - sudo koha-worker --restart --all-queues kohadev - sudo koha-worker --stop --queue long_tasks kohadev For reference, the updated help with the new --all-queues option: koha-worker This script lets you manage the worker daemon for your Koha instances. Usage: koha-worker [--start|--stop|--restart] [--queue queue_name|--all-queues] [--quiet|-q] instancename1 [instancename2...] koha-worker --status instancename1 [instancename2...] koha-worker -h|--help --start Start the worker daemon for the specified instances --stop Stop the worker daemon for the specified instances --restart Restart the worker daemon for the specified instances --queue Specify the queue/worker to perform the action on - 'default' is used if not specified (unless --all-queues is passed) current queues are: default, long_tasks --all-queues Perform the action on all defined queues --status Show the status of the worker for the specified instances --quiet|-q Make the script quiet about non existent instance names (useful for calling from another scripts). --help|-h Display this help message Note: There used to be a queue called elastic_index, but since the introduction of koha-es-indexer this queue should not be active.
Created attachment 191209 [details] [review] Bug 32736: Add --all-queues switch to koha-worker This patch adds a convenient option switch to the script. It will make it perform the action (start, stop, restart, print status) on all defined queues ('default' and 'long_tasks', as of today). To test, make sure you applied bug 31124: 0. Apply this patch 1. Run: $ ktd --shell --root k$ cp debian/scripts/koha-functions.sh \ /usr/share/koha/bin/koha-functions.sh 2. Play with all the options for: k$ debian/scripts/koha-worker * kohadev => SUCCESS: All options work as expected! Note: you should include (say) having `long_tasks` stopped, and starting all workers with the new parameter. And the same for `--stop` and `--start`. 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 191210 [details] [review] Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nice work everyone! Pushed to main for 26.05