Skip to content

fix(provider): accept schedules while warming up the app - #15

Open
RomainLanz wants to merge 2 commits into
0.xfrom
fix/warmup-fake-adapters
Open

RomainLanz wants to merge 2 commits into
0.xfrom
fix/warmup-fake-adapters

Conversation

@RomainLanz

@RomainLanz RomainLanz commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

A warmed up app never initializes the queue manager, but preload files such as start/scheduler.ts still run. Defining a schedule there makes node ace codegen fail with "QueueManager is not initialized", so apps have to guard their scheduler with app.getMode() !== 'warmup'.

While warming up, the provider now initializes the queue manager with an in-memory fake adapter in place of every configured adapter, so schedules and dispatches made from preload files no longer throw. Delayed dispatches are stored right away instead of through a timer, which would otherwise keep the command running until the delay elapses.

A warmed up app never initializes the queue manager, but preload files
such as "start/scheduler.ts" still run. Defining a schedule there made
`node ace codegen` fail with "QueueManager is not initialized", forcing
apps to guard their scheduler with `app.getMode()`.

While warming up, the provider now initializes the queue manager with a
fake adapter in place of every configured adapter. Schedules and
dispatches become no-ops, and no connection is opened.
The fake adapter used while warming up the app holds delayed jobs in a
setTimeout. A warmed up app never shuts its providers down, so a
preload dispatching with `.in('1h')` kept `node ace codegen` running
until the delay elapsed.

The warmup adapter now pushes delayed jobs right away, which leaves no
timer behind and still never executes them.
@fleet-panda fleet-panda Bot added the status: incoming The status of the hub task label Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: incoming The status of the hub task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant