From c81d1d949d22160044ea9d987792128ec74ce990 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 29 Sep 2015 19:57:22 -0500 Subject: [PATCH] Update global exclusion lists more often than site-specific ones. --- earwigbot/wiki/copyvios/exclusions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/earwigbot/wiki/copyvios/exclusions.py b/earwigbot/wiki/copyvios/exclusions.py index 59dc124..9a4fb2d 100644 --- a/earwigbot/wiki/copyvios/exclusions.py +++ b/earwigbot/wiki/copyvios/exclusions.py @@ -149,11 +149,14 @@ class ExclusionsDB(object): return result[0] if result else 0 def sync(self, sitename, force=False): - """Update the database if it hasn't been updated in the past day. + """Update the database if it hasn't been updated recently. This updates the exclusions database for the site *sitename* and "all". + + Site-specific lists are considered stale after 48 hours; global lists + after 12 hours. """ - max_staleness = 60 * 60 * 24 + max_staleness = 60 * 60 * (12 if sitename == "all" else 48) time_since_update = int(time() - self._get_last_update(sitename)) if force or time_since_update > max_staleness: log = u"Updating stale database: {0} (last updated {1} seconds ago)"