debian-mirror-gitlab/lib/gitlab/database/async_ddl_exclusive_lease_guard.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
379 B
Ruby
Raw Normal View History

2023-03-17 16:20:25 +05:30
# frozen_string_literal: true
module Gitlab
module Database
2023-04-23 21:23:45 +05:30
module AsyncDdlExclusiveLeaseGuard
2023-03-17 16:20:25 +05:30
extend ActiveSupport::Concern
include ExclusiveLeaseGuard
def lease_key
2023-04-23 21:23:45 +05:30
@lease_key ||= "gitlab/database/asyncddl/actions/#{database_config_name}"
2023-03-17 16:20:25 +05:30
end
def database_config_name
2023-04-23 21:23:45 +05:30
connection_db_config.name
2023-03-17 16:20:25 +05:30
end
end
end
end