| … | … | @@ -0,0 +1,63 @@ | |
| 57 | + | ); | |
| 58 | + | // One clock for all due-work sources. A slow source cannot block another | |
| 59 | + | // source or overlap itself, and no extra missed-tick backlog is queued. | |
| 60 | + | yield* Effect.sleep("5 seconds").pipe(Effect.andThen(tick), Effect.forever, Effect.forkScoped); | |
🟡 Medium scheduling/Scheduler.ts:60
The scheduler performs no work for the first five seconds after startup, so overdue tasks and due usage-limit recoveries are unnecessarily delayed. Line 60 enters sleep before the first tick; run tick once before starting the sleeping loop.
No longer relevant as of f5cc6ed2573c9e2c9aa81a6d69bd11530fe3a768
Fixed in b875b89: each source checks due work immediately when it registers, then uses the shared five-second scheduler. A tick during scheduler construction would run before sources exist, so registration is the useful startup trigger. The focused tests now wait for startup receipts before advancing the clock; all 50 scheduler/task tests and the server typecheck pass.