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 'lib/gitlab/patch/sidekiq_cron_poller.rb')
-rw-r--r--lib/gitlab/patch/sidekiq_cron_poller.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/gitlab/patch/sidekiq_cron_poller.rb b/lib/gitlab/patch/sidekiq_cron_poller.rb
new file mode 100644
index 00000000000..630c364d455
--- /dev/null
+++ b/lib/gitlab/patch/sidekiq_cron_poller.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+# Patch to address https://github.com/ondrejbartas/sidekiq-cron/issues/361
+# This restores the poll interval to v1.2.0 behavior
+# https://github.com/ondrejbartas/sidekiq-cron/blob/v1.2.0/lib/sidekiq/cron/poller.rb#L36-L38
+# This patch only applies to v1.4.0
+require 'sidekiq/cron/version'
+
+if Gem::Version.new(Sidekiq::Cron::VERSION) != Gem::Version.new('1.4.0')
+ raise 'New version of sidekiq-cron detected, please remove or update this patch'
+end
+
+module Gitlab
+ module Patch
+ module SidekiqCronPoller
+ def poll_interval_average
+ Sidekiq.options[:poll_interval] || Sidekiq::Cron::POLL_INTERVAL
+ end
+ end
+ end
+end