From 984298937c7c079167d802c1dac4c906f4f149da Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Thu, 16 Dec 2010 21:06:53 +0100 Subject: [PATCH] Cleanup dead handlers in ml moderation cron. This should avoid manual actions when a temporary error occurred while processing the moderation requests. Signed-off-by: Florent Bruneau --- bin/cron/cron_ml_moderate.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/cron/cron_ml_moderate.php b/bin/cron/cron_ml_moderate.php index c6d22a6..c4d16b5 100755 --- a/bin/cron/cron_ml_moderate.php +++ b/bin/cron/cron_ml_moderate.php @@ -26,6 +26,11 @@ ini_set('memory_limit', '128M'); $sent_mails = 0; $handler = time(); +/* Cleanup dead locks */ +XDB::execute('UPDATE email_list_moderate + SET handler = NULL + WHERE handler < NOW() - 300'); + while ($sent_mails < $globals->lists->max_mail_per_min && time() - $handler < 60) { // take a lock on a mail -- 2.1.4