fix: isolate invalid cron rules during scheduler recovery

This commit is contained in:
whyour
2026-09-27 16:45:09 +08:00
parent a8310e7d51
commit bf63425805
12 changed files with 211 additions and 41 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ test('API accepts legacy question-mark schedules but rejects malformed cron', ()
for (const schedule of [...legacySchedules, '@once', '@boot']) {
assert.equal(scheduleSchema.validate(schedule).error, undefined, schedule);
}
for (const schedule of ['?', '0 /5 * * * ?', '0 70 * * * ?', 'not a cron']) {
for (const schedule of ['@bogus', '0 /5 * * * ?', '0 70 * * * ?', 'not a cron']) {
assert.ok(scheduleSchema.validate(schedule).error, schedule);
}
});
@@ -57,7 +57,7 @@ test('legacy main and extra schedules restore real jobs and healthy readiness',
assert.ok(jobs.every((job) => job.nextInvocation()));
}
const previousJobs = [...stacks.values()].flat();
for (const schedule of ['?', '0 /5 * * * ?', '0 70 * * * ?']) {
for (const schedule of ['@bogus', '0 /5 * * * ?', '0 70 * * * ?']) {
for (const invalid of [
{ ...crons[0], schedule },
{ ...crons[0], extra_schedules: [{ schedule }] },