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

lock_writes.rake « db « gitlab « tasks « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7f3b806b53d8d9f73c5ed93e52ba8efa1a3cec7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

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
      Gitlab::Database::TablesLocker.new(
        logger: Logger.new($stdout),
        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
      Gitlab::Database::TablesLocker.new(
        logger: Logger.new($stdout),
        dry_run: Gitlab::Utils.to_boolean(ENV['DRY_RUN'], default: false)
      ).unlock_writes
    end
  end
end