Skip to content

Commit

Permalink
Merge pull request #12 from smasry/sidekiq_7_compatibility
Browse files Browse the repository at this point in the history
Adding compatibilty upgrade for sidekiq 7
  • Loading branch information
bdurand authored Dec 11, 2023
2 parents 0d34c4b + edf68dd commit 1e68e70
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.0.3

### Changed

- Updated Middleware to include Sidekiq::ClientMiddleware for Sidekiq 7.0 compatibility


## 1.0.2

### Changed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.2
1.0.3
4 changes: 4 additions & 0 deletions lib/sidekiq/transaction_guard/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ module TransactionGuard
# the default behavior set in `Sidekiq::TransactionGuard.mode` and
# `Sidekiq::TransactionGuard.notify` respectively.
class Middleware
if Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new("7.0")
include Sidekiq::ClientMiddleware
end

def call(worker_class, job, queue, redis_pool)
# Check if we need to log this. Also, convert worker_class to its actual class
if in_transaction?
Expand Down

0 comments on commit 1e68e70

Please sign in to comment.