fix(prod): dedupe scheduled tasks and reconcile orphan delivery contracts
Memind CI / Test, build, and release guards (push) Successful in 2m58s
Memind CI / Test, build, and release guards (push) Successful in 2m58s
Prevent duplicate active scheduled tasks, fail static preparing contracts when HTML is missing, raise MindSpace remote timeout default to 30s, and add 103 repair scripts for inspection follow-ups. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -47,6 +47,24 @@ export async function markPageDeliveryContractReady({ pool, userId, relativePath
|
||||
return Number(result?.affectedRows ?? 0) > 0;
|
||||
}
|
||||
|
||||
export async function markPageDeliveryContractFailed({
|
||||
pool,
|
||||
userId,
|
||||
relativePath,
|
||||
failureReason = 'delivery_material_missing',
|
||||
} = {}) {
|
||||
const workspaceRelativePath = normalizeDeliveryRelativePath(relativePath);
|
||||
if (!pool || !userId || !workspaceRelativePath) return false;
|
||||
const now = Date.now();
|
||||
const [result] = await pool.query(
|
||||
`UPDATE h5_page_delivery_contracts
|
||||
SET status = 'failed', failure_reason = ?, updated_at = ?
|
||||
WHERE user_id = ? AND workspace_relative_path = ? AND status = 'preparing'`,
|
||||
[String(failureReason ?? 'delivery_material_missing'), now, userId, workspaceRelativePath],
|
||||
);
|
||||
return Number(result?.affectedRows ?? 0) > 0;
|
||||
}
|
||||
|
||||
export async function releaseMaterializedPageDeliveryContracts({
|
||||
pool,
|
||||
userId,
|
||||
|
||||
Reference in New Issue
Block a user