diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-22 15:08:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-22 15:08:59 +0300 |
commit | 421f6c92d5984d035a7a6687d70277ba88f5f92b (patch) | |
tree | 35286624cfbc591c0f60bf1f0851492cd9d74ae3 /app/services/concerns | |
parent | 44c4a8ee1e7b995aa2045fd31d637981eb3baccb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/concerns')
-rw-r--r-- | app/services/concerns/alert_management/alert_processing.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/app/services/concerns/alert_management/alert_processing.rb b/app/services/concerns/alert_management/alert_processing.rb index de54102bdc8..f10ff4e6f19 100644 --- a/app/services/concerns/alert_management/alert_processing.rb +++ b/app/services/concerns/alert_management/alert_processing.rb @@ -38,7 +38,7 @@ module AlertManagement if alert.resolve(incoming_payload.ends_at) SystemNoteService.change_alert_status(alert, User.alert_bot) - close_issue(alert.issue) if auto_close_incident? + close_issue(alert.issue_id) if auto_close_incident? else logger.warn( message: 'Unable to update AlertManagement::Alert status to resolved', @@ -52,14 +52,10 @@ module AlertManagement alert.register_new_event! end - def close_issue(issue) - return if issue.blank? || issue.closed? + def close_issue(issue_id) + return unless issue_id - ::Issues::CloseService - .new(project: project, current_user: User.alert_bot) - .execute(issue, system_note: false) - - SystemNoteService.auto_resolve_prometheus_alert(issue, project, User.alert_bot) if issue.reset.closed? + ::IncidentManagement::CloseIncidentWorker.perform_async(issue_id) end def process_new_alert @@ -78,7 +74,7 @@ module AlertManagement end def process_incident_issues - return if alert.issue || alert.resolved? + return if alert.issue_id || alert.resolved? ::IncidentManagement::ProcessAlertWorkerV2.perform_async(alert.id) end |