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-master.tar
biblos-stat-master.tar.gz
biblos-stat-master.tar.bz2
biblos-stat-master.tar.lz
biblos-stat-master.tar.xz
biblos-stat-master.tar.zst
biblos-stat-master.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.")