Skip to content

Commit

Permalink
Attempt to fix DeletionWatcher sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- committed Apr 24, 2018
1 parent a0ab392 commit 2a0232e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion deletionwatcher.py
Expand Up @@ -24,7 +24,11 @@ class DeletionWatcher:
def __init__(self):
DeletionWatcher.update_site_id_list()

self.socket = websocket.create_connection("wss://qa.sockets.stackexchange.com/")
try:
self.socket = websocket.create_connection("wss://qa.sockets.stackexchange.com/")
except:
log('error', 'DeletionWatcher failed to create a websocket connection')

self.posts = {}

if os.path.exists("deletionIDs.p"):
Expand Down
2 changes: 1 addition & 1 deletion ws.py
Expand Up @@ -73,7 +73,6 @@

# We need an instance of bodyfetcher before load_files() is called
GlobalVars.bodyfetcher = BodyFetcher()
GlobalVars.deletion_watcher = DeletionWatcher()

load_files()
filter_auto_ignored_posts()
Expand Down Expand Up @@ -109,6 +108,7 @@
")"

GlobalVars.standby_mode = "standby" in sys.argv
GlobalVars.deletion_watcher = DeletionWatcher()

chatcommunicate.init(username, password)
Tasks.periodic(Metasmoke.send_status_ping, interval=60)
Expand Down

0 comments on commit 2a0232e

Please sign in to comment.