Class: RepositoryCheck::DispatchWorker
- Inherits:
-
Object
- Object
- RepositoryCheck::DispatchWorker
- Includes:
- ApplicationWorker, CronjobQueue, EachShardWorker, ExclusiveLeaseGuard
- Defined in:
- app/workers/repository_check/dispatch_worker.rb
Overview
rubocop:disable Scalability/IdempotentWorker
Constant Summary collapse
- LEASE_TIMEOUT =
1.hour
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from Gitlab::Loggable
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Instance Method Summary collapse
Methods included from ExclusiveLeaseGuard
#exclusive_lease, #lease_key, #lease_release?, #lease_taken_log_level, #lease_taken_message, #log_lease_taken, #release_lease, #renew_lease!, #try_obtain_lease
Methods included from EachShardWorker
#each_eligible_shard, #eligible_shard_names, #healthy_ready_shards, #healthy_shard_names, #ready_shards
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#lease_timeout ⇒ Object
30 31 32 |
# File 'app/workers/repository_check/dispatch_worker.rb', line 30 def lease_timeout LEASE_TIMEOUT end |
#perform ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/workers/repository_check/dispatch_worker.rb', line 20 def perform return unless Gitlab::CurrentSettings.repository_checks_enabled try_obtain_lease do each_eligible_shard do |shard_name| RepositoryCheck::BatchWorker.perform_async(shard_name) end end end |