Skip to content

Commit

Permalink
fix added_at
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixellion committed Jun 2, 2023
1 parent 917771c commit 445d7ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,12 @@ def notifier_task_hash(task, label=""):
if expire_hours:
expire_delta = timedelta(hours=int(expire_hours))
try:
due_date = datetime.strptime(item['created_at'], "%Y-%m-%d")
due_date = datetime.strptime(item['added_at'], "%Y-%m-%d")
except:
try:
due_date = datetime.strptime(item['created_at'], "%Y-%m-%dT%H:%M:%S")
due_date = datetime.strptime(item['added_at'], "%Y-%m-%dT%H:%M:%S")
except:
due_date = datetime.strptime(item['created_at'], "%Y-%m-%dT%H:%M:%SZ")
due_date = datetime.strptime(item['added_at'], "%Y-%m-%dT%H:%M:%SZ")
due_date += timedelta(hours=config['local_timezone_offset'])
if datetime.now() - due_date > expire_hours:
print(f"Querying task for deletion due to expiration label: '{str(item)}")
Expand Down

0 comments on commit 445d7ce

Please sign in to comment.