Browse Source

Retry failing zKillboard queries once.

master
Ben Kurtovic 4 years ago
parent
commit
fccc9c33d7
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      calefaction/eve/zkill.py

+ 6
- 1
calefaction/eve/zkill.py View File

@@ -32,7 +32,12 @@ class ZKillboard:
self._debug("[GET] %s", query)

try:
resp = self._session.get(url, timeout=10)
try:
resp = self._session.get(url, timeout=10)
except requests.ConnectionError:
self._logger.warn("zKillboard API query failed, retrying once")
time.sleep(self._MAX_RATE)
resp = self._session.get(url, timeout=10)
resp.raise_for_status()
result = resp.json() if resp.content else None
except (requests.RequestException, ValueError):


Loading…
Cancel
Save