mirror of
https://github.com/hansjone/dsh-ops-cron.git
synced 2026-10-09 01:53:19 +08:00
Fix cron cwd for super_admin and harden IM channel job isolation.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
b35bfde557
commit
b1bb0067a0
16 changed files with 714 additions and 49 deletions
|
|
@ -139,3 +139,24 @@ test('one-shot at fires once then waits as complete even if nextRunAt is null',
|
|||
assert.equal(second.action, 'wait')
|
||||
assert.equal(second.reason, 'complete')
|
||||
})
|
||||
|
||||
test('one-shot misfire beyond grace skips and clears nextRunAt', () => {
|
||||
const at = shanghai(2026, 8, 23, 22, 57)
|
||||
const job = {
|
||||
id: 'at-miss',
|
||||
enabled: true,
|
||||
schedule: { kind: 'at', at: new Date(at).toISOString(), timezone: TZ },
|
||||
nextRunAt: at,
|
||||
createdAt: at - 60_000,
|
||||
}
|
||||
const decision = decideDispatch({
|
||||
job,
|
||||
runs: [],
|
||||
now: at + 5 * 60_000,
|
||||
misfirePolicy: 'skip',
|
||||
graceMs: 60_000,
|
||||
})
|
||||
assert.equal(decision.action, 'skip')
|
||||
assert.equal(decision.reason, 'misfire')
|
||||
assert.equal(decision.nextRunAt, null)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue