Bug 32736

Summary: koha-worker should be able to restart all queues with a single call
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Command-line UtilitiesAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Patch doesn't apply --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: magnus, mtj, nick, robin, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 31124    
Bug Blocks: 35092    
Attachments: Bug 32736: Add --all-queues switch to koha-worker
Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues

Description Nick Clemens (kidclamp) 2023-01-26 17:53:41 UTC
Maybe a --queue all or something?
Comment 1 Magnus Enger 2023-11-08 08:25:35 UTC
+1
Comment 2 Tomás Cohen Arazi (tcohen) 2025-05-21 19:56:04 UTC
Working in the area and this seems trivial with bug 31124 addition.
Comment 3 Tomás Cohen Arazi (tcohen) 2025-05-21 21:06:45 UTC
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
Comment 4 Tomás Cohen Arazi (tcohen) 2025-05-21 21:11:40 UTC
Created attachment 182710 [details] [review]
Bug 32736: (follow-up) Make scripts using koha-worker use --all-queues
Comment 5 Magnus Enger 2025-05-22 06:29:03 UTC
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