File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66from config import API_BASE_URL
77
88
9+ SILENT_PATHS = frozenset (["/health" , "/traffic-light" ])
10+
11+
912class ApiController :
1013 @staticmethod
1114 def _req (method , path , ** kwargs ):
1215 url = f"{ API_BASE_URL } { path } "
1316 start = time .time ()
1417 resp = requests .request (method , url , ** kwargs )
1518 ms = (time .time () - start ) * 1000
16- logging .info (f"[CLIENT] { method .upper ()} { url } -> { resp .status_code } ({ ms :.0f} ms)" )
19+ if path not in SILENT_PATHS :
20+ logging .info (f"[CLIENT] { method .upper ()} { url } -> { resp .status_code } ({ ms :.0f} ms)" )
1721 return resp
1822
1923 @staticmethod
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def __init__(self, usb_id):
1616 self ._usb_id = usb_id
1717 self ._pn532 = None
1818 self ._pending_tag = None
19- if not exists (usb_id ):
19+ if not usb_id or not exists (usb_id ):
2020 logging .error ("Card reader not found at %s, exiting" , usb_id )
2121 sys .exit (1 )
2222 for attempt in range (1 , 6 ):
You can’t perform that action at this time.
0 commit comments