Class: WorkItems::UpdateNamespaceTraversalIdsWorker
- Inherits:
-
Object
- Object
- WorkItems::UpdateNamespaceTraversalIdsWorker
- Includes:
- ApplicationWorker, Gitlab::ExclusiveLeaseHelpers
- Defined in:
- app/workers/work_items/update_namespace_traversal_ids_worker.rb
Constant Summary collapse
- RETRY_IN_IF_LOCKED =
20.seconds
Constants included from Gitlab::ExclusiveLeaseHelpers
Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from Gitlab::Loggable
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_CONCURRENCY_LIMIT_PERCENTAGE_BY_URGENCY, 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 Method Summary collapse
Methods included from Gitlab::ExclusiveLeaseHelpers
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#perform(namespace_id) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/workers/work_items/update_namespace_traversal_ids_worker.rb', line 18 def perform(namespace_id) namespace = Namespace.find_by_id(namespace_id) return unless namespace return unless Feature.enabled?(:update_work_item_traversal_ids_on_transfer, namespace) UpdateNamespaceTraversalIdsService.execute(namespace) rescue Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError logger.info( class: self.class.name, message: "Couldn't obtain the lock. Rescheduling the job.", namespace_id: namespace_id) self.class.perform_in(RETRY_IN_IF_LOCKED, namespace_id) end |