[Koha-bugs] [Bug 15529] Process Message Queue may send duplicate emails if process is launched twice

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Nov 2 09:24:50 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15529

--- Comment #40 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
+print "$0 is already running. Exiting.\n";
+#Send email to inform administrator another process_message_queue.pl cron was
attempted to run whilst previous execution of the file is taking place.
+# Configure accordingly
+MIME::Lite->send( 'smtp', '');
+my $email = MIME::Lite->new(
+To => ' ',
+From => ' ',
+Type => 'TEXT',
+Subject => 'process_message_queue.pl cron is already running',
+Data => 'process_message_queue.pl cron is already running',
+);
+
+$email->attach(
+Type => 'Text',
+ Data => 'process_message_queue.pl cron is already running',
 );
+$email->send();
+exit(1);
+}
I would say: Just print already running to STDERR and quit. No need to send
email. If the administrator wants an email, he can add MAILTO=root in cron.
No need to add MIME::Lite etc.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list