summaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-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.")