needle-innovision / nestjs-tenancy

Multi-tenancy approach for nestjs - currently supported only for mongodb with mongoose
MIT License
186 stars 58 forks source link

Having issue to use cron job while using @InjectTenancyModel in service #50

Open ghost opened 1 year ago

ghost commented 1 year ago

When I'm using the @InjectTenancyModel to initialize any schema in service, in that particular service I won't be able to use @Cron job. I'm getting the following issue. [Scheduler] Cannot register cron job "ServiceName@functionName" because it is defined in a non-static provider.

I tried to remove @InjectTenancyModel from service then it is working properly

manneyugn commented 7 months ago

a problem with this library, it needs to be provided by an HTTP request to decide which tenant connection. So not only cronjob, any queue consumer or gRPC request won't be able to use this library to provide multi-tenancy database connection