Commit 687c56c6 authored by Andreas Brandl's avatar Andreas Brandl

Disable statement_timeout while seeding

parent 06b52982
...@@ -87,7 +87,9 @@ module Gitlab ...@@ -87,7 +87,9 @@ module Gitlab
SeedFu.quiet = true SeedFu.quiet = true
yield without_statement_timeout do
yield
end
SeedFu.quiet = false SeedFu.quiet = false
ActiveRecord::Base.logger = old_logger ActiveRecord::Base.logger = old_logger
...@@ -114,6 +116,13 @@ module Gitlab ...@@ -114,6 +116,13 @@ module Gitlab
def self.mute_mailer def self.mute_mailer
ActionMailer::MessageDelivery.prepend(DeliverNever) ActionMailer::MessageDelivery.prepend(DeliverNever)
end end
def self.without_statement_timeout
ActiveRecord::Base.connection.execute('SET statement_timeout=0')
yield
ensure
ActiveRecord::Base.connection.execute('RESET statement_timeout')
end
end end
end end
# :nocov: # :nocov:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment