]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
recover and keep testing
authorEvan Prodromou <evan@status.net>
Thu, 8 Mar 2012 14:33:51 +0000 (08:33 -0600)
committerEvan Prodromou <evan@status.net>
Thu, 8 Mar 2012 14:33:51 +0000 (08:33 -0600)
scripts/testuser.php

index 707ba409f9f0c62e4291a57b682b5957fff82418..f28a929c46e2c42c0bb7fcc1d5e504f7e7cbd949 100644 (file)
@@ -48,7 +48,11 @@ function testAllUsers($filter) {
 
         if ($found) {
             while ($user->fetch()) {
-                testUser($filter, $user);
+                try {
+                    testUser($filter, $user);
+                } catch (Exception $e) {
+                    printfnq("ERROR testing user %s\n: %s", $user->nickname, $e->getMessage());
+                }
             }
             $offset += $found;
         }
@@ -70,10 +74,14 @@ function testUser($filter, $user) {
     do {
         $notice = $str->getNotices($offset, $limit);
         while ($notice->fetch()) {
-            printfv("Testing notice %d...", $notice->id);
-            $result = $filter->test($notice);
-            Spam_score::save($notice, $result);
-            printfv("%s\n", ($result->isSpam) ? "SPAM" : "HAM");
+            try {
+                printfv("Testing notice %d...", $notice->id);
+                $result = $filter->test($notice);
+                Spam_score::save($notice, $result);
+                printfv("%s\n", ($result->isSpam) ? "SPAM" : "HAM");
+            } catch (Exception $e) {
+                printfnq("ERROR testing notice %d\n: %s", $notice->id, $e->getMessage());
+            }
         }
         $offset += $notice->N;
     } while ($notice->N > 0);