fix memory leak in notification_sound.py
This commit is contained in:
parent
00f754aae9
commit
baf5920c7e
|
@ -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()
|
Loading…
Reference in New Issue