fix memory leak in notification_sound.py

This commit is contained in:
Wardyn 2023-10-06 11:54:24 -07:00
parent 00f754aae9
commit baf5920c7e
1 changed files with 2 additions and 3 deletions

View File

@ -20,11 +20,10 @@ def on_open(ws):
print('Websocket opened') print('Websocket opened')
def on_close(ws, *error): def on_close(ws, *error):
print('Websocket closed, attempting to reconnect') print('Websocket closed, attempting to reconnect')
connect_websocket()
def connect_websocket(): def connect_websocket():
ws = websocket.WebSocketApp("wss://" + config['instance'].split('/')[-1] + "/api/v1/streaming?access_token=" + config['user_token'] + "&stream=user:notification", 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) on_message = on_message, on_open = on_open, on_close = on_close, on_error=on_close)
ws.run_forever() ws.run_forever()
while True:
connect_websocket() connect_websocket()