diff options
Diffstat (limited to 'lib/tasks/gitlab/db/lock_writes.rake')
-rw-r--r-- | lib/tasks/gitlab/db/lock_writes.rake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/db/lock_writes.rake b/lib/tasks/gitlab/db/lock_writes.rake index 7f3b806b53d..59478d47d12 100644 --- a/lib/tasks/gitlab/db/lock_writes.rake +++ b/lib/tasks/gitlab/db/lock_writes.rake @@ -4,16 +4,20 @@ namespace :gitlab do namespace :db do desc "GitLab | DB | Install prevent write triggers on all databases" task lock_writes: [:environment, 'gitlab:db:validate_config'] do + logger = Logger.new($stdout) + logger.level = Gitlab::Utils.to_boolean(ENV['VERBOSE']) ? Logger::INFO : Logger::WARN Gitlab::Database::TablesLocker.new( - logger: Logger.new($stdout), + logger: logger, dry_run: Gitlab::Utils.to_boolean(ENV['DRY_RUN'], default: false) ).lock_writes end desc "GitLab | DB | Remove all triggers that prevents writes from all databases" task unlock_writes: :environment do + logger = Logger.new($stdout) + logger.level = Gitlab::Utils.to_boolean(ENV['VERBOSE']) ? Logger::INFO : Logger::WARN Gitlab::Database::TablesLocker.new( - logger: Logger.new($stdout), + logger: logger, dry_run: Gitlab::Utils.to_boolean(ENV['DRY_RUN'], default: false) ).unlock_writes end |