Bugzilla – Attachment 139027 Details for
Bug 31345
Add ability to exit process_message_queue.pl early if any plugin before_send_messages hook fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31345 - Add ability to exit process_message_queue.pl early if any plugin before_send_messages hook fails
Bug-31345---Add-ability-to-exit-processmessagequeu.patch (text/plain), 2.09 KB, created by
Kyle M Hall (khall)
on 2022-08-11 19:46:25 UTC
(
hide
)
Description:
Bug 31345 - Add ability to exit process_message_queue.pl early if any plugin before_send_messages hook fails
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-08-11 19:46:25 UTC
Size:
2.09 KB
patch
obsolete
>From cfd5ddd2f6ae75e8e7c9f6a4f0fab6362c23a058 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 11 Aug 2022 15:43:15 -0400 >Subject: [PATCH] Bug 31345 - Add ability to exit process_message_queue.pl > early if any plugin before_send_messages hook fails > >Sometimes it would be better for process_message_queue.pl to stop if a plugin hook fails rather than continue processing. It would be nice if that was a command line option. > >Test Plan: >1) Install any plugin with a before_send_messages hook >2) Modify the plugin, add a 'die;' statement at the start of the > before_send_messages method of the plugin. >3) Run process_message_queue.pl as usual >4) Note the exit code is 0 >5) Run it again with the new -e setting >6) Note the exit code is 1 >--- > misc/cronjobs/process_message_queue.pl | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/misc/cronjobs/process_message_queue.pl b/misc/cronjobs/process_message_queue.pl >index d8918be6077..f1518ec3cc7 100755 >--- a/misc/cronjobs/process_message_queue.pl >+++ b/misc/cronjobs/process_message_queue.pl >@@ -34,6 +34,7 @@ my $help = 0; > my $verbose = 0; > my $type = q{}; > my $letter_code; >+my $exit_on_plugin_failure = 0; > > GetOptions( > 'u|username:s' => \$username, >@@ -44,6 +45,7 @@ GetOptions( > 'v|verbose' => \$verbose, > 't|type:s' => \$type, > 'c|code:s' => \$letter_code, >+ 'e|exit-on-plugin-failure' => \$exit_on_plugin_failure, > ); > my $usage = << 'ENDUSAGE'; > >@@ -62,6 +64,7 @@ This script has the following parameters : > -m --method: authentication method required by SMTP server (See perldoc Sendmail.pm for supported authentication types.) > -h --help: this message > -v --verbose: provides verbose output to STDOUT >+ -e --exit-on-plugin-failure: if enabled, script will exit prematurely if any plugin before_send_messages hook fails > ENDUSAGE > > die $usage if $help; >@@ -87,6 +90,7 @@ if ( C4::Context->config("enable_plugins") ) { > } > catch { > warn "$_"; >+ exit 1 if $exit_on_plugin_failure; > }; > } > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31345
:
139027
|
143381
|
155227
|
161952
|
165712