Browse Source

ban page that throws the error and stuck the crawl queue

main
ghost 2 years ago
parent
commit
512bd56056
  1. 21
      crontab/crawler.php

21
crontab/crawler.php

@ -796,13 +796,32 @@ try {
} }
} }
// Apply changes
$db->commit(); $db->commit();
// Process update errors
} catch(Exception $e) { } catch(Exception $e) {
// Decline DB changes
$db->rollBack();
// Debug std
var_dump($e); var_dump($e);
$db->rollBack(); // Ban page that throws the error and stuck the crawl queue
if (!empty($queueHostPage->hostPageId)) {
$hostPagesBanned = $db->updateHostPageTimeBanned($queueHostPage->hostPageId, time());
// Reset counters
$hostPagesProcessed = $hostPagesBanned;
$manifestsProcessed = 0;
$hostPagesIndexed = 0;
$manifestsAdded = 0;
$hostPagesAdded = 0;
$hostsAdded = 0;
$hostPagesSnapAdded = 0;
}
} }
// Debug // Debug

Loading…
Cancel
Save