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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/web_hooks/log_destroy_worker.rb')
-rw-r--r--app/workers/web_hooks/log_destroy_worker.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/workers/web_hooks/log_destroy_worker.rb b/app/workers/web_hooks/log_destroy_worker.rb
new file mode 100644
index 00000000000..9ea5c70e416
--- /dev/null
+++ b/app/workers/web_hooks/log_destroy_worker.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+module WebHooks
+ class LogDestroyWorker
+ include ApplicationWorker
+
+ DestroyError = Class.new(StandardError)
+
+ data_consistency :always
+ feature_category :integrations
+ 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