Skip to content

Commit

Permalink
back(socket): update last connection on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
t-h2o authored and RobinBurri committed Dec 18, 2024
1 parent 0d7f309 commit d43eb45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/matcha/websocket/main_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from matcha.utils import flaskprint

from matcha.db.last_connection import db_update_last_connection

from matcha.websocket.socket_manager import SocketManager


Expand Down Expand Up @@ -33,6 +35,7 @@ def on_connect(self, auth):

def on_disconnect(self):
try:
db_update_last_connection(SocketManager.get_user_id(request.sid))
SocketManager.remove_session(request.sid)
except Exception as e:
flaskprint("Error handling message:" + str(e))
Expand Down

0 comments on commit d43eb45

Please sign in to comment.