Prevent not needed use if database connections.

This commit is contained in:
Martin Edenhofer 2015-09-04 02:22:20 +02:00
parent 810f34a648
commit 0100b38386

View file

@ -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']