diff options
Diffstat (limited to 'lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb')
-rw-r--r-- | lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb b/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb index 10a69acc037..883e1ba0558 100644 --- a/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb +++ b/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb @@ -20,8 +20,7 @@ module Gitlab class DuplicateJob include Gitlab::Utils::StrongMemoize - DEFAULT_DUPLICATE_KEY_TTL = 6.hours - SHORT_DUPLICATE_KEY_TTL = 10.minutes + DEFAULT_DUPLICATE_KEY_TTL = 10.minutes DEFAULT_STRATEGY = :until_executing STRATEGY_NONE = :none @@ -75,7 +74,8 @@ module Gitlab argv = [] job_wal_locations.each do |connection_name, location| - argv += [connection_name, pg_wal_lsn_diff(connection_name), location] + diff = pg_wal_lsn_diff(connection_name) + argv += [connection_name, diff || '', location] end with_redis { |r| r.eval(UPDATE_WAL_COOKIE_SCRIPT, keys: [cookie_key], argv: argv) } @@ -174,7 +174,7 @@ module Gitlab end def duplicate_key_ttl - options[:ttl] || default_duplicate_key_ttl + options[:ttl] || DEFAULT_DUPLICATE_KEY_TTL end private @@ -183,12 +183,6 @@ module Gitlab attr_reader :queue_name, :job attr_writer :existing_jid - def default_duplicate_key_ttl - return SHORT_DUPLICATE_KEY_TTL if Feature.enabled?(:reduce_duplicate_job_key_ttl) - - DEFAULT_DUPLICATE_KEY_TTL - end - def worker_klass @worker_klass ||= worker_class_name.to_s.safe_constantize end |