Class: IncidentManagement::ProcessAlertWorker

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

Overview

rubocop:disable Scalability/IdempotentWorker

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(_project_id = nil, _alert_payload = nil, alert_id = nil) ⇒ Object

`project_id` and `alert_payload` are deprecated and can be removed starting from 14.0 release gitlab.com/gitlab-org/gitlab/-/issues/224500


13
14
15
16
17
18
19
20
21
22
23
# File 'app/workers/incident_management/process_alert_worker.rb', line 13

def perform(_project_id = nil, _alert_payload = nil, alert_id = nil)
  return unless alert_id

  alert = find_alert(alert_id)
  return unless alert

  result = create_issue_for(alert)
  return if result.success?

  log_warning(alert, result)
end