fix(scheduled-task): release page delivery contracts before notifying users
Memind CI / Test, build, and release guards (push) Successful in 3m36s

Scheduled automation now prepares and retries MindSpace delivery contracts,
blocks WeChat pushes when public HTML links are not ready, and reconciles
stuck static preparing contracts on each worker scan.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-16 08:26:21 +08:00
parent 2b58cdc2c8
commit 7c0ed58ae1
4 changed files with 429 additions and 30 deletions
+10
View File
@@ -2,6 +2,7 @@ import {
executeScheduledTask,
formatScheduledTaskDeliveryMessage,
looksLikeScheduledTaskNonDelivery,
reconcileStuckStaticPageDeliveryContracts,
} from './scheduled-task-executor.mjs';
export function startScheduledTaskWorker({
@@ -67,6 +68,15 @@ export function startScheduledTaskWorker({
if (running || stopped) return;
running = true;
try {
if (pool && h5Root) {
await reconcileStuckStaticPageDeliveryContracts({
pool,
h5Root,
logger,
}).catch((err) => {
logger.warn?.('Scheduled task delivery reconcile failed:', err);
});
}
const dueTasks = await scheduledTaskService.listDueTasks({ limit: 10 });
for (const candidate of dueTasks) {
const task = await scheduledTaskService.lockTask(candidate.id);