Merge remote branch 'origin/xorg/maint' into xorg/1.0.2/master
[platal.git] / bin / cron / cron_ml_moderate.php
index 13cf6d2..c4d16b5 100755 (executable)
@@ -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
@@ -37,7 +42,7 @@ while ($sent_mails < $globals->lists->max_mail_per_min
     if (XDB::affectedRows() == 0) {
         break;
     }
-    $query = XDB::query('SELECT  a.fullname, a.uid, a.password,
+    $query = XDB::query('SELECT  a.full_name, a.uid, a.password,
                                  ml.ml, ml.domain, ml.mid, ml.action, ml.message
                            FROM  accounts            AS a
                      INNER JOIN  email_list_moderate AS ml ON (a.uid = ml.uid)