diff --git a/modules/weather_api.py b/modules/weather_api.py index 52f6603..28964e4 100644 --- a/modules/weather_api.py +++ b/modules/weather_api.py @@ -26,7 +26,7 @@ class DarkSkyAPI: except: pass - if statinfo is None or datetime.fromtimestamp(statinfo.st_mtime, tz=timezone.utc) > datetime.now(tz=timezone.utc) + timedelta(hours=1): + if statinfo is None or datetime.fromtimestamp(statinfo.st_mtime, tz=timezone.utc) + timedelta(hours=1) < datetime.now(tz=timezone.utc): # Do the request and save it with urllib.request.urlopen(self.baseurl + "/" + str(self.apikey) + "/" + gps + "?" + "&".join([opt+"="+self.opts[opt] for opt in self.opts])) as f: with open(self._cached_file % gps, 'wb') as fd: