mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-11-03 03:03:43 +08:00
Update sunnylinkd.py to improve logging and connection timeout
The commit enhances the logging in the selfdrive/athena/sunnylinkd.py by adding an info statement when the handle_long_poll function starts. It also modifies the create_connection function call, removing the fixed 30 seconds timeout, providing more flexibility for connection time.
This commit is contained in:
@@ -28,6 +28,7 @@ LOCAL_PORT_WHITELIST = {8022}
|
||||
params = Params()
|
||||
sunnylink_api = SunnylinkApi(params.get("SunnylinkDongleId", encoding='utf-8'))
|
||||
def handle_long_poll(ws: WebSocket, exit_event: threading.Event | None) -> None:
|
||||
cloudlog.info("sunnylinkd.handle_long_poll started")
|
||||
end_event = threading.Event()
|
||||
|
||||
threads = [
|
||||
@@ -169,8 +170,7 @@ def main(exit_event: threading.Event = None):
|
||||
cloudlog.event("sunnylinkd.main.connecting_ws", ws_uri=ws_uri, retries=conn_retries)
|
||||
ws = create_connection(ws_uri,
|
||||
cookie="jwt=" + sunnylink_api.get_token(),
|
||||
enable_multithread=True,
|
||||
timeout=30.0)
|
||||
enable_multithread=True)
|
||||
cloudlog.event("sunnylinkd.main.connected_ws", ws_uri=ws_uri, retries=conn_retries,
|
||||
duration=time.monotonic() - conn_start)
|
||||
conn_start = None
|
||||
|
||||
Reference in New Issue
Block a user