fix(scheduled-task): release page delivery contracts before notifying users
Memind CI / Test, build, and release guards (push) Successful in 3m36s
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user