diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /lib/backup | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'lib/backup')
-rw-r--r-- | lib/backup/files.rb | 2 | ||||
-rw-r--r-- | lib/backup/manager.rb | 18 |
2 files changed, 9 insertions, 11 deletions
diff --git a/lib/backup/files.rb b/lib/backup/files.rb index 55b10c008fb..9b019f16ddd 100644 --- a/lib/backup/files.rb +++ b/lib/backup/files.rb @@ -157,7 +157,7 @@ module Backup end def backup_files_realpath - @backup_files_realpath ||= File.join(Gitlab.config.backup.path, File.basename(@app_files_dir) ) + @backup_files_realpath ||= File.join(Gitlab.config.backup.path, File.basename(@app_files_dir)) end end end diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb index a8b3c12a2a2..f8424f6250e 100644 --- a/lib/backup/manager.rb +++ b/lib/backup/manager.rb @@ -218,7 +218,7 @@ module Backup build_backup_information - definitions.keys.each do |task_name| + definitions.each_key do |task_name| run_create_task(task_name) end @@ -239,7 +239,7 @@ module Backup read_backup_information verify_backup_version - definitions.keys.each do |task_name| + definitions.each_key do |task_name| if !skipped?(task_name) && enabled_task?(task_name) run_restore_task(task_name) end @@ -263,7 +263,7 @@ module Backup def write_backup_information # Make sure there is a connection - ::Gitlab::Database.database_base_models.values.each do |base_model| + ::Gitlab::Database.database_base_models.each_value do |base_model| base_model.connection.reconnect! end @@ -277,7 +277,7 @@ module Backup def build_backup_information @backup_information ||= { db_version: ActiveRecord::Migrator.current_version.to_s, - backup_created_at: Time.now, + backup_created_at: Time.current, gitlab_version: Gitlab::VERSION, tar_version: tar_version, installation_type: Gitlab::INSTALLATION_TYPE, @@ -291,7 +291,7 @@ module Backup @backup_information.merge!( full_backup_id: full_backup_id, db_version: ActiveRecord::Migrator.current_version.to_s, - backup_created_at: Time.zone.now, + backup_created_at: Time.current, gitlab_version: Gitlab::VERSION, tar_version: tar_version, installation_type: Gitlab::INSTALLATION_TYPE, @@ -396,7 +396,7 @@ module Backup timestamp = matched[1].to_i - next unless Time.at(timestamp) < (Time.now - keep_time) + next unless Time.zone.at(timestamp) < (Time.current - keep_time) begin FileUtils.rm(file) @@ -523,9 +523,7 @@ module Backup end def object_storage_config - @object_storage_config ||= begin - ObjectStorage::Config.new(Gitlab.config.backup.upload) - end + @object_storage_config ||= ObjectStorage::Config.new(Gitlab.config.backup.upload) end def connect_to_remote_directory @@ -613,7 +611,7 @@ module Backup end def puts_time(msg) - progress.puts "#{Time.now} -- #{msg}" + progress.puts "#{Time.current} -- #{msg}" Gitlab::BackupLogger.info(message: "#{Rainbow.uncolor(msg)}") end end |