浏览代码

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):


正在加载...
取消
保存