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

Possible to lazily load tenant in sidekiq middleware? #235

Open
eapache-opslevel opened this issue May 22, 2024 · 0 comments
Open

Possible to lazily load tenant in sidekiq middleware? #235

eapache-opslevel opened this issue May 22, 2024 · 0 comments

Comments

@eapache-opslevel
Copy link

eapache-opslevel commented May 22, 2024

First, thanks for such a useful gem!

We have a setup where we run a lot of sidekiq jobs using the middleware from this gem. They are all tenant-scoped, but a lot of them never actually need the tenant object itself, just the ID (to attach as a where clause to other queries).

We have found that our database is doing a fair bit of extra work loading the tenant object in all of these jobs (not because the query is expensive, but because of the volume of jobs we run), which is ultimately unused. We were hoping there was a way to make the sidekiq middleware load the tenant object lazily? Or the ability to flag jobs as not needing the full object, and just using the ID from the job args (in the way that MultiTenant.with(id) is already supported) or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant