fix(mindspace): release edited public pages and fix achievements dates
Memind CI / Test, build, and release guards (push) Successful in 3m37s
Memind CI / Test, build, and release guards (push) Successful in 3m37s
Finish now releases static HTML delivery contracts in a finally block so re-edited pages are not stuck at HTTP 409, and M成果 groups pages by Asia/Shanghai calendar dates to avoid duplicate day headings. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -46,3 +46,34 @@ export async function markPageDeliveryContractReady({ pool, userId, relativePath
|
||||
);
|
||||
return Number(result?.affectedRows ?? 0) > 0;
|
||||
}
|
||||
|
||||
export async function releaseMaterializedPageDeliveryContracts({
|
||||
pool,
|
||||
userId,
|
||||
relativePaths = [],
|
||||
allowPgRequired = false,
|
||||
} = {}) {
|
||||
if (!pool || !userId) return [];
|
||||
const released = [];
|
||||
for (const rawPath of relativePaths) {
|
||||
const workspaceRelativePath = normalizeDeliveryRelativePath(rawPath);
|
||||
if (!workspaceRelativePath) continue;
|
||||
const contract = await getPageDeliveryContract({
|
||||
pool,
|
||||
userId,
|
||||
relativePath: workspaceRelativePath,
|
||||
});
|
||||
if (!contract || contract.status === 'ready') continue;
|
||||
if (contract.data_mode === 'pg_required' && !allowPgRequired) continue;
|
||||
if (
|
||||
await markPageDeliveryContractReady({
|
||||
pool,
|
||||
userId,
|
||||
relativePath: workspaceRelativePath,
|
||||
})
|
||||
) {
|
||||
released.push(workspaceRelativePath);
|
||||
}
|
||||
}
|
||||
return released;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user