Skip to content

Commit

Permalink
fix breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Apr 8, 2022
1 parent 51697b8 commit 1e01328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/sidekiq/xaclient.rb
Expand Up @@ -19,9 +19,9 @@ module XAClient
# * nil or false means enqueue the job immediately, Sidekiq's default behavior
def push(item)
# Sidekiq::Job does not merge sidekiq_options so we need to fallback
policy = item.delete("xa") {
policy = item.fetch("xa") { |key|
kl = item["class"]
kl.is_a?(Sidekiq::Job) ? kl.get_sidekiq_options["xa"] : nil
kl.respond_to?(:get_sidekiq_options) ? kl.get_sidekiq_options[key] : nil
}
if policy == "commit" || policy == true
after_commit { super }
Expand Down
2 changes: 1 addition & 1 deletion test/test_xa.rb
Expand Up @@ -4,7 +4,7 @@
require "sidekiq/api"
require "sidekiq/rails"
require "sidekiq/xaclient"
Sidekiq.transactional!
Sidekiq.transactional_push!

require_relative "./dummy/config/environment"

Expand Down

0 comments on commit 1e01328

Please sign in to comment.