Skip to content

Commit

Permalink
Update ws.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffschaller authored Nov 3, 2023
1 parent 1d3e5d8 commit 3cb136f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import traceback
from bodyfetcher import BodyFetcher
import chatcommunicate
from datetime import datetime
from datetime import datetime, timezone
from spamhandling import check_if_spam_json
from globalvars import GlobalVars
from datahandling import (load_pickle, PICKLE_STORAGE, load_files, filter_auto_ignored_posts,
Expand Down Expand Up @@ -230,7 +230,7 @@ def check_socket_connections():
socket_failure = False
with chatcommunicate._clients_lock:
for client in chatcommunicate._clients.values():
if client.last_activity and (datetime.now(datetime.UTC) - client.last_activity).total_seconds() >= 60:
if client.last_activity and (datetime.now(tz=timezone.utc) - client.last_activity).total_seconds() >= 60:
socket_failure = True
if socket_failure:
exit_mode("socket_failure")
Expand Down Expand Up @@ -313,7 +313,7 @@ def init_se_websocket_or_reboot(max_tries, tell_debug_room_on_error=False):

except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
now = datetime.now(datetime.UTC)
now = datetime.now(tz=timezone.utc)
delta = now - GlobalVars.startup_utc_date
seconds = delta.total_seconds()
tr = traceback.format_exc()
Expand Down

0 comments on commit 3cb136f

Please sign in to comment.