fix(consult): a warm that cannot be scheduled no longer fails the save (BUG-1305)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
cd625e8a35
commit
b4eedb7725
@@ -54,12 +54,19 @@ export function scheduleConsultPacketWarm(
|
||||
const body = consultWarmBodyFromColumns(columns);
|
||||
if (!body) return false;
|
||||
const apiBase = deps.apiBase ?? "http://127.0.0.1:5200";
|
||||
deps.after(() => {
|
||||
return deps.fetch(`${apiBase}/api/consultation_workflow`, {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
body: JSON.stringify(body),
|
||||
}).then(() => undefined).catch(() => undefined);
|
||||
});
|
||||
// Warm is best effort. `after` throws outside a request scope; the save has
|
||||
// already been written by then, so a scheduling failure must not turn it
|
||||
// into a 500 (BUG-1305).
|
||||
try {
|
||||
deps.after(() => {
|
||||
return deps.fetch(`${apiBase}/api/consultation_workflow`, {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
body: JSON.stringify(body),
|
||||
}).then(() => undefined).catch(() => undefined);
|
||||
});
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user