瀏覽代碼

Retry failing zKillboard queries once.

master
Ben Kurtovic 7 年之前
父節點
當前提交
fccc9c33d7
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. +6
    -1
      calefaction/eve/zkill.py

+ 6
- 1
calefaction/eve/zkill.py 查看文件

@@ -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…
取消
儲存