(spec: string, reason: string)
| 136 | } |
| 137 | |
| 138 | function debugInvalidSpec(spec: string, reason: string): void { |
| 139 | // We do not pull in a logger here — `clock.ts` is the lowest layer of |
| 140 | // the cron module and must stay dependency-free so it can be imported |
| 141 | // from anywhere (including lint rules, type files). A stderr write |
| 142 | // gated on KIMI_CRON_DEBUG is enough — production is silent. |
| 143 | if (process.env['KIMI_CRON_DEBUG'] === '1') { |
| 144 | process.stderr.write( |
| 145 | `[cron/clock] invalid KIMI_CRON_CLOCK spec ${JSON.stringify(spec)}: ${reason} — falling back to system clock\n`, |
| 146 | ); |
| 147 | } |
| 148 | } |
no test coverage detected