summaryrefslogtreecommitdiff
path: root/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'api.py')
-rw-r--r--api.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/api.py b/api.py
index 9e5a8d7..7843f12 100644
--- a/api.py
+++ b/api.py
@@ -34,9 +34,14 @@ async def crawl_region(region):
region, last_match_update)
# wait for http requests
- matches = await api.matches_since(last_match_update,
- region=region,
- params={"page[limit]": 50})
+ try:
+ matches = await api.matches_since(last_match_update,
+ region=region,
+ params={"page[limit]": 50})
+ except:
+ logging.error("%s: connection error, retrying", region)
+ await asyncio.sleep(5)
+
if len(matches) > 0:
logging.debug("%s: %s objects", region, len(matches))
else: