-
Notifications
You must be signed in to change notification settings - Fork 59
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
Is need provider with manual get tenant service? #45
Comments
@xiaokhkh thanks for writing in. Yes you are correct the tenant can be resolved only by a request context until its available (since the information of the tenant is embedded inside the request context). But i did't get you last point on |
@sandeepsuvit pr is about manual get model above the above requirements. The last question is the idea when doing the above requirements. but it has not been fully implemented. |
@xiaokhkh your solution looks promising. I can evaluate it if you can provide a working example. |
Hi guys, an example of use when I add a service to a Bull queue: myapi | 2023-03-22T04:09:56.482Z ioredis:redis write command[221.20.0.5:6379]: 0 -> hmset('xxx:mail-queue:9,attemptsMade,1,stacktrace,["TypeError: req.get is not a function\n at Function.getTenantFromRequest (/home/node/app/node_modules/@needle-innovision/nestjs-tenancy/dist/tenancy-core ... The request context is not available... I believe the solution would be to pass the tenantId manually from the Job parameters. |
Hi @sandeepsuvit ,
Thank you very much for developing this interesting module for multi tenancy and its helping me a lot.
All service need request context, because scope of "TENANT-CONTEXT"
Request context be destroy when i called method of tenant service because i use Subscription Publishing Mode.
[error] req is undefine
so i write this
Manual service will not spread [request] scope.
If need i will submit the pr.
A question
Can we improve the performance of tenant mode by saving service instances or manually obtaining models?
Thanks for all of your efforts. Looking forward to your reply :)
The text was updated successfully, but these errors were encountered: