Class: IssueRebalancingWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker
Defined in:
app/workers/issue_rebalancing_worker.rb

Constant Summary

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 Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#perform(ignore = nil, project_id = nil) ⇒ Object


10
11
12
13
14
15
16
17
18
19
# File 'app/workers/issue_rebalancing_worker.rb', line 10

def perform(ignore = nil, project_id = nil)
  return if project_id.nil?

  project = Project.find(project_id)
  issue = project.issues.first # All issues are equivalent as far as we are concerned

  IssueRebalancingService.new(issue).execute
rescue ActiveRecord::RecordNotFound, IssueRebalancingService::TooManyIssues => e
  Gitlab::ErrorTracking.log_exception(e, project_id: project_id)
end