Bug 27265 - Process message queue cron should be able to take multiple types as a parameter
Summary: Process message queue cron should be able to take multiple types as a parameter
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on: 25097
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-17 17:39 UTC by Nick Clemens
Modified: 2022-08-05 17:54 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patch adds the ability to specify several types or letter codes when running the process_message_queue script. This allows libraries to consolidate calls when some message types or letter codes are scheduled differently than others
Version(s) released in:


Attachments
Bug 27265: Enable message queue cron to accept multiple codes and types (3.64 KB, patch)
2020-12-18 13:53 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 27265: Enable message queue cron to accept multiple codes and types (3.80 KB, patch)
2020-12-18 14:00 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 27265: Enable message queue cron to accept multiple codes and types (4.52 KB, patch)
2020-12-18 14:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 27265: Enable message queue cron to accept multiple codes and types (4.51 KB, patch)
2021-01-20 12:51 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27265: Enable message queue cron to accept multiple codes and types (4.58 KB, patch)
2021-06-08 11:14 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 27265: Enable message queue cron to accept multiple codes and types (4.93 KB, patch)
2022-02-10 20:54 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27265: Enable message queue cron to accept multiple codes and types (5.00 KB, patch)
2022-03-07 13:43 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27265: Enable message queue cron to accept multiple codes and types (5.00 KB, patch)
2022-08-05 17:54 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-12-17 17:39:23 UTC
It would be nice to be able to combine several types in a single run, but exclude others, without having to have multiple cron lines
Comment 1 Kyle M Hall 2020-12-18 13:53:27 UTC
Created attachment 114522 [details] [review]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits
Comment 2 Kyle M Hall 2020-12-18 14:00:50 UTC
Created attachment 114523 [details] [review]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits
Comment 3 Kyle M Hall 2020-12-18 14:02:08 UTC
Created attachment 114525 [details] [review]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits
Comment 4 Andrew Fuerste-Henry 2020-12-23 14:58:24 UTC
This isn't working for me. Here's what I see:
1- have a patron with email enabled for CHECKOUT, CHECKIN notices and an email address on their account
2- check item out to patron, check item in again
3- confirm on patron notices page that they have pending CHECKOUT and CHECKIN notices
4- perl misc/cronjobs/process_message_queue.pl -c CHECKOUT -c CHECKIN
5- notices are not sent
6- perl misc/cronjobs/process_message_queue.pl -c CHECKOUT
7- one notice is sent
Comment 5 Nick Clemens 2021-01-20 12:51:41 UTC
Created attachment 115430 [details] [review]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits
Comment 6 David Nind 2021-06-05 20:43:16 UTC
Patch no longer applies 8-(..

root@kohadevbox:koha(bz27265)$ git bz apply 27265

Bug 27265 - Process message queue cron should be able to take multiple types as a parameter

115430 - Bug 27265: Enable message queue cron to accept multiple codes and types

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 27265: Enable message queue cron to accept multiple codes and types
Using index info to reconstruct a base tree...
M	C4/Letters.pm
M	misc/cronjobs/process_message_queue.pl
Falling back to patching base and 3-way merge...
Auto-merging misc/cronjobs/process_message_queue.pl
Auto-merging C4/Letters.pm
CONFLICT (content): Merge conflict in C4/Letters.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 27265: Enable message queue cron to accept multiple codes and types
Comment 7 Kyle M Hall 2021-06-08 11:14:19 UTC
Created attachment 121717 [details] [review]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits
Comment 8 David Nind 2021-12-08 03:40:47 UTC
I get this message when running the script after the patch is applied (koha-testing-docker):

root@kohadevbox:koha(bz27265)$ perl misc/cronjobs/process_message_queue.pl -c HOLD
Global symbol "$type" requires explicit package name (did you forget to declare "my $type"?) at misc/cronjobs/process_message_queue.pl line 89.
Global symbol "$letter_code" requires explicit package name (did you forget to declare "my $letter_code"?) at misc/cronjobs/process_message_queue.pl line 90.
Type of arg 1 to Try::Tiny::catch must be block or sub {} (not reference constructor) at misc/cronjobs/process_message_queue.pl line 96, near "};"
Type of arg 1 to Try::Tiny::try must be block or sub {} (not reference constructor) at misc/cronjobs/process_message_queue.pl line 96, near "};"
Execution of misc/cronjobs/process_message_queue.pl aborted due to compilation errors.

It worked with a single letter type before the patch was applied.
Comment 9 David Cook 2021-12-08 04:48:55 UTC
I was going to write a very different comment here based on what I read in the "Text to go in the release notes", but after re-reading the comments and code, I realized I totally misunderstood this change.

You might consider changing the phrasing to something like "This patch allows one to specify several types or letter codes, instead of only one type or letter code, when running the process_message_queue script. This allows libraries to consolidate calls when some messages types or letter codes are scheduled differently than others."

I thought this patch added the ability to specify types or letter codes in general, and I was going to comment on that ability, but that ability was added in a previous ticket...
Comment 10 Nick Clemens 2022-02-10 20:54:47 UTC
Created attachment 130476 [details] [review]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits
Comment 11 Andrew Fuerste-Henry 2022-03-01 13:52:23 UTC
I'm getting this error when trying to run process_message_queue with this patch:

Global symbol "$letter_code" requires explicit package name (did you forget to declare "my $letter_code"?) at misc/cronjobs/process_message_queue.pl line 84.
Type of arg 1 to Try::Tiny::catch must be block or sub {} (not reference constructor) at misc/cronjobs/process_message_queue.pl line 90, near "};"
Type of arg 1 to Try::Tiny::try must be block or sub {} (not reference constructor) at misc/cronjobs/process_message_queue.pl line 90, near "};"
Execution of misc/cronjobs/process_message_queue.pl aborted due to compilation errors.
Comment 12 Nick Clemens 2022-03-07 13:43:35 UTC
Created attachment 131434 [details] [review]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits
Comment 13 Andrew Fuerste-Henry 2022-08-05 17:54:02 UTC
Created attachment 138712 [details] [review]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits