charkost / prosopite

:mag: Rails N+1 queries auto-detection with zero false positives / false negatives
Apache License 2.0
1.48k stars 45 forks source link

Adding Sidekiq middleware #76

Closed JoeKaldas closed 9 months ago

JoeKaldas commented 9 months ago

I'm having an issue setting up prosopite with sidekiq.

I added the same snippet in the docs but getting uninitialized constant Sidekiq::ServerMiddleware.

I'm using Sidekiq 4.2.10 I tried checking if Prosopite needs a certain version for that but no luck. Any help?

Omar3ain commented 9 months ago

Sidekiq::ServerMiddleware was introduced in version 6.5.0 so you'll need to check when adding the middleware. You can wrap the snippet with the following condition

 if Sidekiq::VERSION >= '6.5.0' && (Rails.env.development? || Rails.env.test?)

I've made a PR to add this to the documentation

JoeKaldas commented 9 months ago

Thank you! This was very helpful. Closing this now.