X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fcron_ml_moderate.php;h=c4d16b5a4c25b3d8640c94279a4772dad9f2de9b;hb=cafb410fea6f257f45da08631c6cdb5c35f86b17;hp=c6d22a6753fbdcb7cb9481d6586608290630aa19;hpb=bbc7476ed266ed900cc53d2a6623bb05eba64b47;p=platal.git 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