From b056eb04ed63c096561526e1ce8cf6fba3df74be Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 1 Sep 2024 21:36:24 -0400 Subject: [PATCH] doorcontrol: Add some more debug logging in update_doors task --- doorcontrol/tasks/update_doors.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doorcontrol/tasks/update_doors.py b/doorcontrol/tasks/update_doors.py index f3952ff..4f0e74d 100644 --- a/doorcontrol/tasks/update_doors.py +++ b/doorcontrol/tasks/update_doors.py @@ -208,11 +208,14 @@ class DoorMember: def update_door(door: Door, dry_run: bool = False): + logger.info(f"Updating {door}") + logger.debug(f"Fetching members from database for {door}") members = [ DoorMember.from_membershipworks_member(membershipworks_member, door) for membershipworks_member in (Member.objects.with_is_active()).all() ] + logger.debug(f"Fetching cardholders from {door}") cardholders = { member.membershipworks_id: member for member in [ @@ -221,11 +224,13 @@ def update_door(door: Door, dry_run: bool = False): ] } + logger.debug(f"Fetching credentials from {door}") existing_door_credentials = { Credential.from_hex(c.attrib["rawCardNumber"]) for c in door.controller.get_credentials() } + logger.debug(f"Syncing members with {door}") # TODO: can I combine requests? for member in members: # cardholder did not exist, so add them