mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-12 11:52:01 +01:00
Fixes #1915. Only clear the connection pool if it exists
git-svn-id: file:///home/svn/framework3/trunk@9301 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
f440317225
commit
10364dc70d
@ -26,12 +26,12 @@ module DBSave
|
|||||||
def self.included(mod)
|
def self.included(mod)
|
||||||
class << mod
|
class << mod
|
||||||
def find(*args)
|
def find(*args)
|
||||||
ActiveRecord::Base.connection_pool.clear_stale_cached_connections!
|
ActiveRecord::Base.connection_pool.clear_stale_cached_connections! if ActiveRecord::Base.connection_pool
|
||||||
super(*args)
|
super(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def save(*args)
|
def save(*args)
|
||||||
ActiveRecord::Base.connection_pool.clear_stale_cached_connections!
|
ActiveRecord::Base.connection_pool.clear_stale_cached_connections! if ActiveRecord::Base.connection_pool
|
||||||
super(*args)
|
super(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user