diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-02-27 10:03:17 +0100 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-02-27 10:03:59 +0100 |
commit | a6017d61e18c4705637bd2c84425cfc2e3daa875 (patch) | |
tree | 0360d18ce5c7214337fa21f73bc4b49f622a8d3f /scripts/maint | |
parent | 95800369863824d8fd255f45ae3586cd88611587 (diff) | |
download | tor-a6017d61e18c4705637bd2c84425cfc2e3daa875.tar.gz tor-a6017d61e18c4705637bd2c84425cfc2e3daa875.zip |
Fix minor fallback directory script issues with time zones
Diffstat (limited to 'scripts/maint')
-rwxr-xr-x | scripts/maint/updateFallbackDirs.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/maint/updateFallbackDirs.py b/scripts/maint/updateFallbackDirs.py index 884d566bb4..63aaeed267 100755 --- a/scripts/maint/updateFallbackDirs.py +++ b/scripts/maint/updateFallbackDirs.py @@ -360,6 +360,7 @@ def onionoo_fetch(what, **kwargs): # Check for freshness if last_mod < required_freshness: if last_mod_date is not None: + # This check sometimes fails transiently, retry the script if it does date_message = "Outdated data: last updated " + last_mod_date else: date_message = "No data: never downloaded " @@ -406,7 +407,7 @@ def fetch(what, **kwargs): ## Fallback Candidate Class class Candidate(object): - CUTOFF_ADDRESS_AND_PORT_STABLE = (datetime.datetime.now() + CUTOFF_ADDRESS_AND_PORT_STABLE = (datetime.datetime.utcnow() - datetime.timedelta(ADDRESS_AND_PORT_STABLE_DAYS)) def __init__(self, details): @@ -599,7 +600,7 @@ class Candidate(object): periods = history.keys() periods.sort(key = lambda x: history[x]['interval']) - now = datetime.datetime.now() + now = datetime.datetime.utcnow() newest = now for p in periods: h = history[p] |