You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/runtime-cloudflare/src/allocation-lifecycle.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,7 @@ export class CloudflareAllocationLifecycle {
102
102
])
103
103
}
104
104
if(awaittableExists(this.database,"wp_codebox_api_admin_claims"))awaitthis.database.prepare("UPDATE wp_codebox_api_admin_claims SET state = 'expired', updated_at = ? WHERE site_id = ? AND state = 'pending'").bind(now,identity.siteId).run()
105
+
if(awaittableExists(this.database,"wp_codebox_runtime_dispatches"))awaitthis.database.prepare("UPDATE wp_codebox_runtime_dispatches SET state = 'done', last_error = 'Allocation deletion fenced this dispatch.', completed_at = ?, updated_at = ? WHERE site_id = ? AND state NOT IN ('done','dead-letter')").bind(now,now,identity.siteId).run()
for(consttableoftables)if(awaittableExists(this.database,table))unresolved+=(awaitthis.database.prepare(`SELECT COUNT(*) AS count FROM ${table} WHERE site_id = ?`).bind(siteId).first<{count: number}>())?.count??0
try{if(!env.WORDPRESS_RUNTIME_QUEUE)thrownewError("Runtime queue binding is unavailable.");awaitenv.WORDPRESS_RUNTIME_QUEUE.send(message);awaitoperations.deliveredDispatch(message)}catch(error){awaitoperations.failedDispatch(message,error);console.error("Runtime queue producer is backpressured; reconciliation will retry.",error)}
try{if(!env.WORDPRESS_RUNTIME_QUEUE)thrownewError("Runtime queue binding is unavailable.");awaitenv.WORDPRESS_RUNTIME_QUEUE.send(message);awaitoperations.deliveredDispatch(message);return"queued"}catch(error){awaitoperations.failedDispatch(message,error);console.error("Runtime queue producer is backpressured; reconciliation will retry.",error);return"backpressured"}
letbody: Record<string,unknown>;try{body=JSON.parse(newTextDecoder("utf-8",{fatal: true}).decode(bytes))}catch{thrownewStaticArtifactImportError("Provisioning request must be valid UTF-8 JSON.",400)}
0 commit comments