From 1f83971dcd9d270699bb5f8d4593e1e160b2ba3f Mon Sep 17 00:00:00 2001 From: Dom Date: Fri, 12 Jul 2024 19:55:03 +0100 Subject: [PATCH] Cosmetic tweaks --- SentNotifications.json | 4 ++-- ShipmentNotifier.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SentNotifications.json b/SentNotifications.json index 198898a..47fdafb 100644 --- a/SentNotifications.json +++ b/SentNotifications.json @@ -1,7 +1,7 @@ { "NotificationsSent": [ "UID1", - "UID1", - "UID1" + "UID2", + "UID3" ] } \ No newline at end of file diff --git a/ShipmentNotifier.py b/ShipmentNotifier.py index 1d8a440..1010ffe 100644 --- a/ShipmentNotifier.py +++ b/ShipmentNotifier.py @@ -48,7 +48,7 @@ def isIDInSentNotifications(inboundPlanId): else: return False -def isShipmentWithinSpecifiedDelta(shipmentCreationTime): +def isShipmentWithinSpecifiedDelta(shipmentCreationTime, delta=360): currentTime = datetime.now() shipmentTime = datetime.strptime(shipmentCreationTime, '%Y-%m-%dT%H:%M:%SZ') timeDelta = currentTime - shipmentTime @@ -57,7 +57,7 @@ def isShipmentWithinSpecifiedDelta(shipmentCreationTime): log(f'Shipment creation time: {shipmentTime}', 'info') log(f'Time delta: {timeDelta}', 'info') - if timeDelta < timedelta(minutes=360): + if timeDelta < timedelta(minutes=delta): return True else: return False