implement socket heartbeat
This commit is contained in:
@@ -258,6 +258,12 @@ def on_leave(data):
|
||||
conversation_id = data.get('conversation_id')
|
||||
leave_room(f'conversation_{conversation_id}')
|
||||
|
||||
@socketio.on('heartbeat')
|
||||
@login_required
|
||||
def on_heartbeat(data):
|
||||
# Just acknowledge the heartbeat to keep the connection alive
|
||||
return {'status': 'ok'}
|
||||
|
||||
@conversations_bp.route('/<int:conversation_id>/send_message', methods=['POST'])
|
||||
@login_required
|
||||
@require_password_change
|
||||
|
||||
Reference in New Issue
Block a user