Clear panne_level if the address hasn't failed for 1 year.
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 21 Dec 2006 22:47:42 +0000 (22:47 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 21 Dec 2006 22:47:42 +0000 (22:47 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1308 839d8a87-29fc-0310-9880-83ba4fa771e5

bin/emails.broken.php

index d1a31f7..6c7c5f8 100755 (executable)
@@ -96,6 +96,10 @@ XDB::execute("UPDATE emails
                  SET panne_level = panne_level - 1
                WHERE flags = 'active' AND panne_level > 1
                      AND last != CURDATE()");
+XDB::execute("UPDATE emails
+                 SET panne_level = 0
+               WHERE flags = 'active' AND panne_level = 1
+                     AND DATE_ADD(last, INTERVAL 1 YEAR) < CURDATE()");
 
 $csv = "nom;prenom;promo;alias;bounce;nbmails\n";
 foreach ($list as $alias=>$mails) {