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/build_hooks_worker.rb')
-rw-r--r--app/workers/build_hooks_worker.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/workers/build_hooks_worker.rb b/app/workers/build_hooks_worker.rb
index 5e05063f058..be79d6b2afb 100644
--- a/app/workers/build_hooks_worker.rb
+++ b/app/workers/build_hooks_worker.rb
@@ -2,6 +2,8 @@
class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
+
+ sidekiq_options retry: 3
include PipelineQueue
queue_namespace :pipeline_hooks
@@ -9,6 +11,16 @@ class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker
urgency :high
data_consistency :delayed, feature_flag: :load_balancing_for_build_hooks_worker
+ DATA_CONSISTENCY_DELAY = 3
+
+ def self.perform_async(*args)
+ if Feature.enabled?(:delayed_perform_for_build_hooks_worker, default_enabled: :yaml)
+ perform_in(DATA_CONSISTENCY_DELAY.seconds, *args)
+ else
+ super
+ end
+ end
+
# rubocop: disable CodeReuse/ActiveRecord
def perform(build_id)
Ci::Build.includes({ runner: :tags })