diff --git a/lib/sidekiq_unique_jobs/lock.rb b/lib/sidekiq_unique_jobs/lock.rb index f7d000cd..cfd2a6b8 100644 --- a/lib/sidekiq_unique_jobs/lock.rb +++ b/lib/sidekiq_unique_jobs/lock.rb @@ -33,7 +33,7 @@ class Lock # rubocop:disable Metrics/ClassLength # # @return [Lock] a newly lock that has been locked # - def self.create(digest, job_id, lock_info = {}, time: Timing.now_f, score: nil) + def self.create(digest, job_id, lock_info: {}, time: Timing.now_f, score: nil) lock = new(digest, time: time) lock.lock(job_id, lock_info, score) lock diff --git a/spec/sidekiq_unique_jobs/lock_spec.rb b/spec/sidekiq_unique_jobs/lock_spec.rb index f545e662..cc916234 100644 --- a/spec/sidekiq_unique_jobs/lock_spec.rb +++ b/spec/sidekiq_unique_jobs/lock_spec.rb @@ -41,7 +41,7 @@ its(:to_s) { is_expected.to eq(expected_string) } describe ".create" do - subject(:create) { described_class.create(key, job_id, lock_info) } + subject(:create) { described_class.create(key, job_id, lock_info: lock_info) } it "creates all expected keys in redis" do create @@ -77,7 +77,7 @@ describe "#del" do subject(:del) { lock.del } - let(:lock) { described_class.create(key, job_id, info) } + let(:lock) { described_class.create(key, job_id, lock_info: info) } it "creates keys and adds job_id to locked hash" do expect { lock }.to change { entity.locked_jids }.to([job_id]) diff --git a/spec/sidekiq_unique_jobs/lua/reap_orphans_spec.rb b/spec/sidekiq_unique_jobs/lua/reap_orphans_spec.rb index 6a934338..c938d1f0 100644 --- a/spec/sidekiq_unique_jobs/lua/reap_orphans_spec.rb +++ b/spec/sidekiq_unique_jobs/lua/reap_orphans_spec.rb @@ -19,7 +19,7 @@ end let(:argv) { [100, threshold] } let(:digest) { "uniquejobs:digest" } - let(:lock) { SidekiqUniqueJobs::Lock.create(digest, job_id, lock_info) } + let(:lock) { SidekiqUniqueJobs::Lock.create(digest, job_id, lock_info: lock_info) } let(:job_id) { "job_id" } let(:item) { raw_item } let(:created_at) { (Time.now - 1000).to_f } diff --git a/spec/sidekiq_unique_jobs/orphans/reaper_spec.rb b/spec/sidekiq_unique_jobs/orphans/reaper_spec.rb index fc61f63b..4ecb2bb2 100644 --- a/spec/sidekiq_unique_jobs/orphans/reaper_spec.rb +++ b/spec/sidekiq_unique_jobs/orphans/reaper_spec.rb @@ -5,7 +5,7 @@ let(:digest) { "uniquejobs:digest" } let(:job_id) { "job_id" } let(:item) { raw_item } - let(:lock) { SidekiqUniqueJobs::Lock.create(digest, job_id, lock_info, score: score) } + let(:lock) { SidekiqUniqueJobs::Lock.create(digest, job_id, lock_info: lock_info, score: score) } let(:raw_item) { { "class" => MyUniqueJob, "args" => [], "jid" => job_id, "lock_digest" => digest } } let(:score) do @@ -161,7 +161,7 @@ end context "when digest has :RUN suffix" do - let(:lock) { SidekiqUniqueJobs::Lock.create("#{digest}:RUN", job_id, lock_info) } + let(:lock) { SidekiqUniqueJobs::Lock.create("#{digest}:RUN", job_id, lock_info: lock_info) } context "that matches current digest" do # rubocop:disable RSpec/NestedGroups let(:created_at) { (Time.now - (reaper_timeout + 100)).to_f } diff --git a/spec/sidekiq_unique_jobs/orphans/ruby_reaper_spec.rb b/spec/sidekiq_unique_jobs/orphans/ruby_reaper_spec.rb index b1d10aa2..26f60ac7 100644 --- a/spec/sidekiq_unique_jobs/orphans/ruby_reaper_spec.rb +++ b/spec/sidekiq_unique_jobs/orphans/ruby_reaper_spec.rb @@ -5,7 +5,7 @@ let(:digest) { "uniquejobs:digest" } let(:job_id) { "job_id" } let(:item) { raw_item } - let(:lock) { SidekiqUniqueJobs::Lock.create(digest, job_id, lock_info, score: score) } + let(:lock) { SidekiqUniqueJobs::Lock.create(digest, job_id, lock_info: lock_info, score: score) } let(:raw_item) { { "class" => MyUniqueJob, "args" => [], "jid" => job_id, "lock_digest" => digest } } let(:lock_info) do {