Welcome to mirror list, hosted at ThFree Co, Russian Federation.

log_destroy_worker.rb « web_hooks « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d678b5536e7304e69fc70ef40987c509742ef954 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module WebHooks
  class LogDestroyWorker
    include ApplicationWorker

    DestroyError = Class.new(StandardError)

    data_consistency :always
    feature_category :webhooks
    urgency :low

    idempotent!

    def perform(params = {})
      hook_id = params['hook_id']
      return unless hook_id

      result = ::WebHooks::LogDestroyService.new(hook_id).execute

      result.track_and_raise_exception(as: DestroyError, web_hook_id: hook_id)
    end
  end
end