-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix that :PRIMED keys are seemingly not removed (#574)
* Adds coverage for batch delete * The created_at belongs to payload This prevents the reaper from crashing * Prevent keys from bleeding out into the wild There shouldn't be any need for these keys after a lock has been achieved * Always clear out info, primed and queued
- Loading branch information
Showing
10 changed files
with
100 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
RSpec.describe SidekiqUniqueJobs::BatchDelete do | ||
let(:digests) { [] } | ||
let(:locks) { [] } | ||
|
||
describe ".call" do | ||
subject(:call) { described_class.call(digests) } | ||
|
||
before do | ||
10.times do |_n| | ||
digest = SecureRandom.hex | ||
lock = SidekiqUniqueJobs::Lock.create(digest, digest) | ||
|
||
lock.queue(digest) | ||
lock.prime(digest) | ||
|
||
digests << digest | ||
locks << lock | ||
end | ||
end | ||
|
||
it "deletes all digests (locked, primed, queued and run keys)" do | ||
call | ||
|
||
locks.all? do |lock| | ||
expect(lock.all_jids).to match_array([]) | ||
expect(unique_keys).to match_array([]) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters