Skip to content

Commit

Permalink
chore(lint): lint'em real good
Browse files Browse the repository at this point in the history
  • Loading branch information
mhenrixon committed Feb 7, 2024
1 parent 413baac commit bc058f4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Layout/EndAlignment:
Layout/LineContinuationLeadingSpace:
Enabled: false

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Lint/AmbiguousBlockAssociation:
Exclude:
- spec/**/*
Expand Down
8 changes: 4 additions & 4 deletions lib/sidekiq_unique_jobs/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class Config < ThreadSafeConfig
# @return [Hash<Symbol, SidekiqUniqueJobs::Lock::BaseLock] all available default locks
LOCKS =
LOCKS_WHEN_BUSY.dup
.merge(LOCKS_WHILE_ENQUEUED.dup)
.merge(LOCKS_WITHOUT_UNLOCK.dup)
.merge(LOCKS_FROM_PUSH_TO_PROCESSED.dup)
.freeze
.merge(LOCKS_WHILE_ENQUEUED.dup)
.merge(LOCKS_WITHOUT_UNLOCK.dup)
.merge(LOCKS_FROM_PUSH_TO_PROCESSED.dup)
.freeze

#
# @return [Hash<Symbol, SidekiqUniqueJobs::OnConflict::Strategy] all available default strategies
Expand Down
4 changes: 2 additions & 2 deletions lib/sidekiq_unique_jobs/locksmith.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ def primed_async(conn, wait = nil, &block) # rubocop:disable Metrics/MethodLengt

# NOTE: When debugging, change .value to .value!
primed_jid = Concurrent::Promises
.future(conn) { |red_con| pop_queued(red_con, timeout) }
.value
.future(conn) { |red_con| pop_queued(red_con, timeout) }
.value

handle_primed(primed_jid, &block)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/sidekiq_unique_jobs/lua/unlock_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
context "with same job_id", :with_a_lock do
it "does unlock" do
expect { unlock }.to change { changelogs.count }.by(1)
.and change { digests.count }.by(-1)
.and change { digests.count }.by(-1)

expect(queued.count).to eq(1)
expect(queued.entries).to contain_exactly("1")
Expand Down

0 comments on commit bc058f4

Please sign in to comment.