From 0100b383868b0601b2433eef3508588b07776a58 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 4 Sep 2015 02:22:20 +0200 Subject: [PATCH] Prevent not needed use if database connections. --- script/websocket-server.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/websocket-server.rb b/script/websocket-server.rb index 46d69399a..2118942db 100755 --- a/script/websocket-server.rb +++ b/script/websocket-server.rb @@ -184,7 +184,9 @@ EventMachine.run { # get user_id if data && data['session_id'] + ActiveRecord::Base.establish_connection session = ActiveRecord::SessionStore::Session.find_by( session_id: data['session_id'] ) + ActiveRecord::Base.remove_connection end if session && session.data && session.data['user_id']