Class: PauseControl::ResumeWorker
- Inherits:
-
Object
- Object
- PauseControl::ResumeWorker
- Includes:
- ApplicationWorker, CronjobQueue
- Defined in:
- app/workers/pause_control/resume_worker.rb
Constant Summary collapse
- RESCHEDULE_DELAY =
1.second
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 Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#perform ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/workers/pause_control/resume_worker.rb', line 17 def perform reschedule_job = false pause_strategies_workers.each do |strategy, workers| strategy_klass = Gitlab::SidekiqMiddleware::PauseControl.for(strategy) next if strategy_klass.should_pause? workers.each do |worker| next unless jobs_in_the_queue?(worker) queue_size = resume_processing!(worker) reschedule_job = true if queue_size.to_i > 0 end end self.class.perform_in(RESCHEDULE_DELAY) if reschedule_job end |