fix(workflow): skip Manager queue ops when Manager is mid-operation
Publish to Comfy registry / Publish Custom Node to registry (push) Has been cancelled
Publish to Comfy registry / Publish Custom Node to registry (push) Has been cancelled
This commit is contained in:
@@ -684,6 +684,20 @@ function enablePayload(dirName, info) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Whether ComfyUI Manager is mid-operation. Used to avoid resetting its queue
|
||||||
|
// out from under an in-progress install/disable (the manual disable flow guards
|
||||||
|
// the same way before calling runManagerDisable).
|
||||||
|
async function managerIsBusy() {
|
||||||
|
try {
|
||||||
|
const r = await fetch("/manager/queue/status");
|
||||||
|
if (!r.ok) return false;
|
||||||
|
const st = await r.json();
|
||||||
|
return !!(st && st.is_processing);
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function runManagerEnable(payload) {
|
async function runManagerEnable(payload) {
|
||||||
await fetch("/manager/queue/reset", { method: "POST", headers: { "Content-Type": "application/json" } });
|
await fetch("/manager/queue/reset", { method: "POST", headers: { "Content-Type": "application/json" } });
|
||||||
|
|
||||||
@@ -707,6 +721,11 @@ async function handleEnable(pkg, temporary, dialog) {
|
|||||||
const info = entry && entry.info;
|
const info = entry && entry.info;
|
||||||
if (!info) return;
|
if (!info) return;
|
||||||
|
|
||||||
|
if (await managerIsBusy()) {
|
||||||
|
notify("ComfyUI Manager is busy. Please try again in a moment.", "warn");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setWorkflowButtonsBusy(dialog, true);
|
setWorkflowButtonsBusy(dialog, true);
|
||||||
try {
|
try {
|
||||||
await runManagerEnable(enablePayload(pkg, info));
|
await runManagerEnable(enablePayload(pkg, info));
|
||||||
@@ -784,6 +803,10 @@ async function processExpiredTrials() {
|
|||||||
const mgr = await fetchManagerInfo();
|
const mgr = await fetchManagerInfo();
|
||||||
if (!mgr) return; // Manager unavailable — leave rows for a later session
|
if (!mgr) return; // Manager unavailable — leave rows for a later session
|
||||||
|
|
||||||
|
// Don't reset Manager's queue out from under an in-progress operation
|
||||||
|
// (e.g. startup install work); the expired rows persist and retry next session.
|
||||||
|
if (await managerIsBusy()) return;
|
||||||
|
|
||||||
const done = [];
|
const done = [];
|
||||||
for (const t of expired) {
|
for (const t of expired) {
|
||||||
const info = mgr[t.package];
|
const info = mgr[t.package];
|
||||||
|
|||||||
Reference in New Issue
Block a user