Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix replace conflict strategy #314

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/sidekiq_unique_jobs/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ def configure_middleware

def configure_server_middleware
Sidekiq.configure_server do |config|
config.client_middleware do |chain|
require 'sidekiq_unique_jobs/client/middleware'
chain.add SidekiqUniqueJobs::Client::Middleware
end

config.server_middleware do |chain|
require 'sidekiq_unique_jobs/server/middleware'
chain.add SidekiqUniqueJobs::Server::Middleware
Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq_unique_jobs/on_conflict.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module OnConflict
log: OnConflict::Log,
raise: OnConflict::Raise,
reject: OnConflict::Reject,
replace: OnConflict::Replace,
reschedule: OnConflict::Reschedule,
}.freeze

Expand Down
3 changes: 0 additions & 3 deletions spec/unit/sidekiq_unique_jobs/middleware_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
it 'adds client and server middleware when required' do
expect(Sidekiq).to receive(:configure_server).and_yield(server_config)

expect(server_config).to receive(:client_middleware).and_yield(client_middleware)
expect(client_middleware).to receive(:add).with(SidekiqUniqueJobs::Client::Middleware)

expect(server_config).to receive(:server_middleware).and_yield(server_middleware)
expect(server_middleware).to receive(:add).with(SidekiqUniqueJobs::Server::Middleware)
described_class.configure_server_middleware
Expand Down