This commit is contained in:
2026-08-14 09:14:52 +08:00
parent 274a3f34c5
commit db80701534
8 changed files with 186 additions and 75 deletions
@@ -27,7 +27,7 @@ test('覆盖模板生命周期、版本冲突、定时任务、幂等、查询
]) assert.match(moduleSource, new RegExp(token))
assert.match(moduleSource, /recipientType:\s*'PLATFORM_ROLE'/)
assert.match(moduleSource, /roleCode:\s*'PLATFORM_ADMIN'/)
assert.match(moduleSource, /Date\.now\(\) \+ 24 \* 60 \* 60 \* 1000/)
assert.match(moduleSource, /Date\.now\(\) \+ 365 \* 24 \* 60 \* 60 \* 1000/)
})
test('异常路径会取消定时任务并停用模板,不实际投递验收消息', () => {
@@ -94,7 +94,7 @@ export async function run(context) {
template?.status === 'ACTIVE' && Number(template?.version) === 3,
`status=${template?.status || 'missing'}, version=${template?.version ?? 'missing'}`, OPTIONS)
const scheduledAt = new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString().slice(0, 19)
const scheduledAt = new Date(Date.now() + 365 * 24 * 60 * 60 * 1000).toISOString().slice(0, 19)
const idempotencyKey = `${context.marker}-notification-scheduled`.slice(0, 128)
const taskCreate = {
tenantId: 0,