'Cron Jobs in NestJS schema-based multitenancy application using TypeORM and Bull

In my application there are several "partners", where each one is a tenant. Is there any way for each partner to perform the same jobs at the same scheduled time using Bull repeat option? Example: all partners every day at 8 AM must perform the "wake up" job and at 9 AM the "breakfast" job. An even better approach would be: as soon as the "wake up" job, scheduled for 8 AM, completes without errors, start the "breakfast" job.

These jobs would modify the partner database so I need to know how to separate the contexts and each job be executed by each partner in the right way.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source