From baf5920c7e01702780946e8f97e6d597651921fd Mon Sep 17 00:00:00 2001 From: Wardyn Date: Fri, 6 Oct 2023 11:54:24 -0700 Subject: [PATCH] fix memory leak in notification_sound.py --- notification_sound.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/notification_sound.py b/notification_sound.py index a3e9e60..9aaa4b8 100644 --- a/notification_sound.py +++ b/notification_sound.py @@ -20,11 +20,10 @@ def on_open(ws): print('Websocket opened') def on_close(ws, *error): print('Websocket closed, attempting to reconnect') - connect_websocket() - def connect_websocket(): ws = websocket.WebSocketApp("wss://" + config['instance'].split('/')[-1] + "/api/v1/streaming?access_token=" + config['user_token'] + "&stream=user:notification", on_message = on_message, on_open = on_open, on_close = on_close, on_error=on_close) ws.run_forever() -connect_websocket() \ No newline at end of file +while True: + connect_websocket() \ No newline at end of file