Update shipment tracking logic and debugging output
- Adjusted shipment tracking logic in `start_loop` function. - Added logging output for the number of events retrieved for a tracking number.
This commit is contained in:
parent
1a8d5608a0
commit
d09daaa0cc
1 changed files with 2 additions and 1 deletions
|
@ -221,10 +221,11 @@ def start_loop(db: sqlite3.Connection, api: KeyDelivery) -> Never:
|
|||
logging.debug(f"Checking shipment {tracking_number} with carrier {carrier}")
|
||||
|
||||
latest_known_event = get_latest_event(db, shipment_id)
|
||||
|
||||
all_events = api.realtime(carrier, tracking_number)
|
||||
|
||||
try:
|
||||
logging.debug(f"Got events for {tracking_number}: {len(all_events)}")
|
||||
logging.debug(f"Got events for {tracking_number}: {len(all_events['data']['items'])}")
|
||||
except KeyError:
|
||||
print(f"Error getting events for {tracking_number}: {all_events}")
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue