Class: ClusterUpdateAppWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker, ClusterApplications, ClusterQueue, ExclusiveLeaseGuard
Defined in:
app/workers/cluster_update_app_worker.rb

Overview

rubocop:disable Scalability/IdempotentWorker

Constant Summary collapse

UpdateAlreadyInProgressError =
Class.new(StandardError)
LEASE_TIMEOUT =
10.minutes.to_i

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY

Constants included from WorkerAttributes

WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from ExclusiveLeaseGuard

#exclusive_lease, #lease_release?, #log_error, #release_lease, #renew_lease!, #try_obtain_lease

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#perform(app_name, app_id, project_id, scheduled_time) ⇒ Object


16
17
18
19
20
21
22
# File 'app/workers/cluster_update_app_worker.rb', line 16

def perform(app_name, app_id, project_id, scheduled_time)
  @app_id = app_id

  try_obtain_lease do
    execute(app_name, app_id, project_id, scheduled_time)
  end
end