summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-11-15 18:46:16 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2022-11-15 18:46:16 +0100
commit221bf94786188918efa89b0358ff5d1b06969e34 (patch)
tree9e88a210a83ec178e62f5994e488eb38fafa7330
parentuse DateTime instead of ISO 8601, added missing duration to db (diff)
downloadbiblos-stat-221bf94786188918efa89b0358ff5d1b06969e34.tar
biblos-stat-221bf94786188918efa89b0358ff5d1b06969e34.tar.gz
biblos-stat-221bf94786188918efa89b0358ff5d1b06969e34.tar.bz2
biblos-stat-221bf94786188918efa89b0358ff5d1b06969e34.tar.lz
biblos-stat-221bf94786188918efa89b0358ff5d1b06969e34.tar.xz
biblos-stat-221bf94786188918efa89b0358ff5d1b06969e34.tar.zst
biblos-stat-221bf94786188918efa89b0358ff5d1b06969e34.zip
-rwxr-xr-xapp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/app.py b/app.py
index 198eff9..4fb9add 100755
--- a/app.py
+++ b/app.py
@@ -80,7 +80,7 @@ def update(engine, hmfan2iarts=100):
if (r.status_code == 200):
failed_acsms_not200_in_a_row = 0
if r.status_code != 200:
- if borrow.purchase_utc > datetime.now(timezone.utc) - timedelta(hours=1):
+ if borrow.purchase_utc != None and borrow.purchase_utc > datetime.now(timezone.utc).replace(tzinfo=None) - timedelta(hours=1):
logger.info(f"we are done for now, as server responded with {r.status_code} for queried acsm id {acsm_id} and the last requested acsm was created less than an hour ago")
break
logger.warning(f"received http response with error code not 200 (it is {r.status_code}). if this continues for {hmfan2iarts-failed_acsms_not200_in_a_row} more requests, I'll assume there are no more borrows on the server.")