计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
nestjs-bullmq【效率与协作】Implement BullMQ job workflows in NestJS. Use when building queue processors, redis-throttler, Upstash limits, idle polling, stalled jobs, and retention policies.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
drainDelay + stalledInterval + maxStalledCount to every @Processor. Default drainDelay (5 ms) burns 570M Redis commands/day at idle. See patterns.md.BaseProcessor instead of WorkerHost to rate-limit these logs. See patterns.md.removeOnComplete, removeOnFail, attempts, backoff to every BullModule.registerQueue. See patterns.md.src/common/constants/bull-queue.constants.ts. Key constants: QUEUE_DRAIN_DELAY_MS (10 000 ms), QUEUE_STALLED_INTERVAL_MS (60 000 ms). Use getSharedBullQueueOptions helper for registerQueue. Queue/job names go in {feature}.constants.ts. Never inline magic numbers.queue.add(): Persist DB record first, then enqueue inside try-catch. Redis errors must not surface as 500s. See patterns.md.ThrottlerGuard registered as global APP_GUARD — Redis blip propagates errors to ALL HTTP routes. RedisThrottlerStorage.increment() must catch all Redis errors and return fail-open pass-through record. Redis blip must not kill all HTTP routes. See patterns.md.isRedisEnabled() conditional + mock token pattern in every module. NestJS DI throws on startup without mock.@Processor(NAME): Always pass worker options object with drainDelay and stalledInterval.WorkerHost extension: Always extend BaseProcessor instead to intercept and rate-limit worker errors.registerQueue without defaultJobOptions: Omitting causes unbounded Redis memory growth.bull-queue.constants.ts — never write 10_000, 60_000, 50, 20, 3, or 5_000 directly.queue.add(): Wrap in try-catch; persist DB state first.getQueueToken mock when redisEnabled = false.