What problem does it solve?
Enables reliable scheduling of recurring background work by registering repeatable BullMQ jobs from NestJS modules so tasks run automatically on a cron or interval schedule without manual triggers.
Core Features & Use Cases
- BaseCommand integration: Commands extend BaseCommand to upsert repeatable jobs on module init.
- Flexible scheduling: Support for interval-based runs (every N ms) or cron patterns via RepeatOptions.
- Safe local development: Schedulers are skipped when IS_LOCAL=1 to avoid running background jobs in dev environments.
- Processor guidance: Scheduled jobs carry null sessions and processors must call loginMaster instead of setSession.
- Use case: Run hourly metrics aggregation, nightly order syncs, or weekday reports automatically via a repeatable BullMQ job.
Quick Start
Create a BaseCommand subclass with a unique CommandKeyEnum, set repeatOptions and templateOptions, register the command in CommandModule, and ensure the processor uses loginMaster to handle scheduled (null-session) jobs.