mirror of
https://github.com/strapi/strapi.git
synced 2026-06-02 16:27:47 +00:00
e31fe3104a
Two cron / migration providers eagerly require modules they only need
at runtime:
- `services/cron.ts` imports `node-schedule` (~90 ms via `Job` class)
even when `server.cron` is empty. Defer the require to first
`add()` / `start()`.
- `database/src/migrations/{internal,users}.ts` instantiate `Umzug`
immediately in their factory, pulling in the inquirer and
`@rushstack/ts-command-line` chain. Move the construction inside a
lazy `provider()` closure so the require only fires on `shouldRun`,
`up`, or `down`.
~100 ms saved on every boot of a project without active cron tasks
or pending migrations (the common case).