prevent unnecessary websocket event spam

pull/215/head
Aevann 2023-10-07 23:32:09 +03:00
parent 9ba2088472
commit 81ab004f54
1 changed files with 3 additions and 1 deletions

View File

@ -252,8 +252,10 @@ def heartbeat(v):
if g.referrer not in ALLOWED_REFERRERS:
return '', 400
expire_utc = int(time.time()) + 3610
already_there = online[g.referrer].get(v.id)
online[g.referrer][v.id] = (expire_utc, v.username, v.name_color, v.patron, v.id)
refresh_online()
if not already_there:
refresh_online()
return '', 204
@socketio.on('typing')