From c6eeac3554fd80706305bd6df5930b1044c968bd Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Sat, 20 Jun 2020 21:30:17 +0200 Subject: [PATCH] Fix: leave room while async disconnect --- lecture2gether_flask/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lecture2gether_flask/app.py b/lecture2gether_flask/app.py index 2ec1024..41d66a9 100755 --- a/lecture2gether_flask/app.py +++ b/lecture2gether_flask/app.py @@ -226,6 +226,7 @@ def on_leave(data): if not room_token in rooms(sid=request.sid): return {'status_code': 403}, 403 + leave_room(room_token) # Get room from db room = json.loads(db.hget('rooms', room_token)) # Deacrease active users in room @@ -234,8 +235,7 @@ def on_leave(data): emit('room_user_count_update', {"users": room['count']}, room=room_token) # Save in db db.hset('rooms', room_token, json.dumps(room)) - # Leave the socket.io room - leave_room(room_token) + # Return status return {'status_code': 200}, 200