forked from GNUsocial/gnu-social
recover and keep testing
This commit is contained in:
parent
bd2c53414f
commit
7fe0341375
@ -48,7 +48,11 @@ function testAllUsers($filter) {
|
|||||||
|
|
||||||
if ($found) {
|
if ($found) {
|
||||||
while ($user->fetch()) {
|
while ($user->fetch()) {
|
||||||
|
try {
|
||||||
testUser($filter, $user);
|
testUser($filter, $user);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
printfnq("ERROR testing user %s\n: %s", $user->nickname, $e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$offset += $found;
|
$offset += $found;
|
||||||
}
|
}
|
||||||
@ -70,10 +74,14 @@ function testUser($filter, $user) {
|
|||||||
do {
|
do {
|
||||||
$notice = $str->getNotices($offset, $limit);
|
$notice = $str->getNotices($offset, $limit);
|
||||||
while ($notice->fetch()) {
|
while ($notice->fetch()) {
|
||||||
|
try {
|
||||||
printfv("Testing notice %d...", $notice->id);
|
printfv("Testing notice %d...", $notice->id);
|
||||||
$result = $filter->test($notice);
|
$result = $filter->test($notice);
|
||||||
Spam_score::save($notice, $result);
|
Spam_score::save($notice, $result);
|
||||||
printfv("%s\n", ($result->isSpam) ? "SPAM" : "HAM");
|
printfv("%s\n", ($result->isSpam) ? "SPAM" : "HAM");
|
||||||
|
} catch (Exception $e) {
|
||||||
|
printfnq("ERROR testing notice %d\n: %s", $notice->id, $e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$offset += $notice->N;
|
$offset += $notice->N;
|
||||||
} while ($notice->N > 0);
|
} while ($notice->N > 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user