Skip to content

Commit

Permalink
Merge pull request #4292 from hove-io/fix_error_cache_local_jcdecaux
Browse files Browse the repository at this point in the history
[jormun]: Fix error cache local jcdecaux
  • Loading branch information
kadhikari authored Jul 26, 2024
2 parents 8165baa + c84806d commit c1536b8
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,14 @@ def _get_informations(self, poi):
ref = poi.get('properties', {}).get('ref')
service_key = self.WS_URL_TEMPLATE.format(self.contract, self.api_key) + self.network
data = self._data.get(service_key)
if data is None:
if (
data is None
or self._last_update + datetime.timedelta(seconds=self._update_interval) < datetime.datetime.utcnow()
):
self._data[service_key] = self._call_webservice()
self._last_update = datetime.datetime.utcnow()
data = self._data.get(service_key)

if self._last_update + datetime.timedelta(seconds=self._update_interval) < datetime.datetime.utcnow():
service_url = self.WS_URL_TEMPLATE.format(self.contract, self.api_key)
self._data[service_url] = self._call_webservice()
self._last_update = datetime.datetime.utcnow()

data = self._data.get(service_key)
if data and 'status' in data.get(ref, {}):
if data[ref]['status'] == 'OPEN':
return Stands(
Expand Down

0 comments on commit c1536b8

Please sign in to comment.