Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/backup/database.rb')
-rw-r--r--lib/backup/database.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index 851445f703d..0429d9496d6 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -140,7 +140,14 @@ module Backup
'sslcrl' => 'PGSSLCRL',
'sslcompression' => 'PGSSLCOMPRESSION'
}
- args.each { |opt, arg| ENV[arg] = config[opt].to_s if config[opt] }
+ args.each do |opt, arg|
+ # This enables the use of different PostgreSQL settings in
+ # case PgBouncer is used. PgBouncer clears the search path,
+ # which wreaks havoc on Rails if connections are reused.
+ override = "GITLAB_BACKUP_#{arg}"
+ val = ENV[override].presence || config[opt].to_s.presence
+ ENV[arg] = val if val
+ end
end
def report_success(success)