mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 13:09:18 +08:00
fix bug where non-multisite environment would run out of connections
This commit is contained in:
parent
5f7f87437c
commit
ceddb6e0da
|
@ -66,7 +66,11 @@ module Jobs
|
||||||
ActiveRecord::Base.connection_handler.clear_active_connections!
|
ActiveRecord::Base.connection_handler.clear_active_connections!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ensure
|
||||||
|
ActiveRecord::Base.connection_handler.clear_active_connections!
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.enqueue(job_name, opts={})
|
def self.enqueue(job_name, opts={})
|
||||||
|
|
|
@ -4,7 +4,7 @@ module RailsMultisite
|
||||||
|
|
||||||
def self.establish_connection(opts)
|
def self.establish_connection(opts)
|
||||||
if opts[:db] == "default" && (!defined?(@@default_spec) || !@@default_spec)
|
if opts[:db] == "default" && (!defined?(@@default_spec) || !@@default_spec)
|
||||||
ActiveRecord::Base.establish_connection
|
# don't do anything .. handled implicitly
|
||||||
else
|
else
|
||||||
spec = connection_spec(opts) || @@default_spec
|
spec = connection_spec(opts) || @@default_spec
|
||||||
handler = nil
|
handler = nil
|
||||||
|
|
Loading…
Reference in New Issue
Block a user