Prevent not needed use if database connections.
This commit is contained in:
parent
810f34a648
commit
0100b38386
1 changed files with 2 additions and 0 deletions
|
@ -184,7 +184,9 @@ EventMachine.run {
|
||||||
|
|
||||||
# get user_id
|
# get user_id
|
||||||
if data && data['session_id']
|
if data && data['session_id']
|
||||||
|
ActiveRecord::Base.establish_connection
|
||||||
session = ActiveRecord::SessionStore::Session.find_by( session_id: data['session_id'] )
|
session = ActiveRecord::SessionStore::Session.find_by( session_id: data['session_id'] )
|
||||||
|
ActiveRecord::Base.remove_connection
|
||||||
end
|
end
|
||||||
|
|
||||||
if session && session.data && session.data['user_id']
|
if session && session.data && session.data['user_id']
|
||||||
|
|
Loading…
Reference in a new issue