Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.

[BUG] Script is unstable #424

Closed
smith558 opened this issue Apr 4, 2022 · 2 comments · Fixed by #428
Closed

[BUG] Script is unstable #424

smith558 opened this issue Apr 4, 2022 · 2 comments · Fixed by #428
Labels
bug Something isn't working

Comments

@smith558
Copy link

smith558 commented Apr 4, 2022

The script consistently crashes after about an hour of runtime. Tested many times. Crashes with websocket._exceptions.WebSocketConnectionClosedException: Connection to remote host was lost.
image

@smith558 smith558 added the bug Something isn't working label Apr 4, 2022
@ixi2101
Copy link
Collaborator

ixi2101 commented Apr 4, 2022

Very little development is happening now as the event is nearly over. Your best bet is to roll back to a previous version

@bolshoytoster
Copy link

@smith558 I think this should work:

diff --git a/main.py b/main.py
index 9c407c3..55e5490 100755
--- a/main.py
+++ b/main.py
@@ -191,7 +191,11 @@ class PlaceClient:
             )
         )
         while True:
-            msg = ws.recv()
+            try:
+                msg = ws.recv()
+            except websocket._exceptions.WebSocketConnectionClosedException as e:
+                logger.error(e)
+                continue
             if msg is None:
                 logger.error("Reddit failed to acknowledge connection_init")
                 exit()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants