Skip to content

Commit

Permalink
Update ws.py
Browse files Browse the repository at this point in the history
replace datetime.utcnow() with datetime.now(datetime.UTC)
  • Loading branch information
jeffschaller authored Nov 3, 2023
1 parent 53ea49f commit fc1243d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ws.py
Original file line number Diff line number Diff line change
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.utcnow() - client.last_activity).total_seconds() >= 60:
if client.last_activity and (datetime.now(datetime.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.utcnow()
now = datetime.now(datetime.UTC)
delta = now - GlobalVars.startup_utc_date
seconds = delta.total_seconds()
tr = traceback.format_exc()
Expand Down

0 comments on commit fc1243d

Please sign in to comment.