From: Florent Bruneau Date: Thu, 16 Dec 2010 20:06:53 +0000 (+0100) Subject: Cleanup dead handlers in ml moderation cron. X-Git-Tag: xorg/1.0.2~32^2~14 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=984298937c7c079167d802c1dac4c906f4f149da;p=platal.git 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 --- 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