summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-02-08 23:50:10 +0000
committerRobert Speicher <robert@gitlab.com>2016-02-08 23:50:10 +0000
commit76fbb42a47128db963762187e7c465c8c21b20df (patch)
treefdf7e0d1e7ca1c4d59d53e607c96ab7e67eef432
parent16abacb1f07c866e7a1f5deb6a6bc20a4eaee71c (diff)
parent897f18032a471e647e0d796c241f911ac1ad0cd8 (diff)
downloadgitlab-ce-76fbb42a47128db963762187e7c465c8c21b20df.tar.gz
Merge branch 'backup-database-timeout-fix' into 'master'
Fix timeout issue for rake task gitlab:backup:create This is a fix for a database timeout which can occur when the backup create task is taking very long (1-2 hours). It seems that ActiveRecord is loosing the connection after a hour idleness and need to be reconnected before use. See merge request !2757
-rw-r--r--lib/backup/manager.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb
index 099062eeb8b..4962f5e53ce 100644
--- a/lib/backup/manager.rb
+++ b/lib/backup/manager.rb
@@ -1,6 +1,9 @@
module Backup
class Manager
def pack
+ # Make sure there is a connection
+ ActiveRecord::Base.connection.reconnect!
+
# saving additional informations
s = {}
s[:db_version] = "#{ActiveRecord::Migrator.current_version}"