Class: ObjectPool::CreateWorker
- Inherits:
-
Object
- Object
- ObjectPool::CreateWorker
- Includes:
- ApplicationWorker, ExclusiveLeaseGuard, ObjectPoolQueue
- Defined in:
- app/workers/object_pool/create_worker.rb
Overview
rubocop:disable Scalability/IdempotentWorker
Constant Summary
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_DATA_CONSISTENCY_PER_DB, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::LOAD_BALANCED_DATA_CONSISTENCIES, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Instance Attribute Summary collapse
-
#pool ⇒ Object
readonly
Returns the value of attribute pool.
Instance Method Summary collapse
Methods included from ExclusiveLeaseGuard
#exclusive_lease, #lease_release?, #lease_taken_log_level, #lease_taken_message, #log_lease_taken, #release_lease, #renew_lease!, #try_obtain_lease
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Attribute Details
#pool ⇒ Object (readonly)
Returns the value of attribute pool.
13 14 15 |
# File 'app/workers/object_pool/create_worker.rb', line 13 def pool @pool end |
Instance Method Details
#perform(pool_id) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/workers/object_pool/create_worker.rb', line 15 def perform(pool_id) @pool = PoolRepository.find_by_id(pool_id) return unless pool try_obtain_lease do perform_pool_creation end end |