README.md in prosopite-1.4.1 vs README.md in prosopite-1.4.2
- old
+ new
@@ -219,20 +219,27 @@
Rails.configuration.middleware.use(Prosopite::Middleware::Rack)
end
```
### Sidekiq
-We also provide a middleware for sidekiq so that you can auto detect n+1 queries that may occur in a sidekiq job.
+We also provide a middleware for sidekiq `6.5.0+` so that you can auto detect n+1 queries that may occur in a sidekiq job.
You just need to add the following to your sidekiq initializer.
```ruby
Sidekiq.configure_server do |config|
- unless Rails.production?
+ unless Rails.env.production?
config.server_middleware do |chain|
require 'prosopite/middleware/sidekiq'
chain.add(Prosopite::Middleware::Sidekiq)
end
end
+end
+```
+
+For applications running sidekiq < `6.5.0` but want to add the snippet, you can guard the snippet with something like this and remove it once you upgrade sidekiq:
+```ruby
+ if Sidekiq::VERSION >= '6.5.0' && (Rails.env.development? || Rails.env.test?)
+.....
end
```
## Allow list