feat: add dynamic per-image list queue with Start and End nodes
This commit is contained in:
+12
-2
@@ -9,7 +9,9 @@ export function setupInterceptor(extension) {
|
||||
const hasCollector = findNodesByClass(prompt.output, NODE_CLASSES.DISTRIBUTED_COLLECTOR).length > 0;
|
||||
const hasDistUpscale = findNodesByClass(prompt.output, NODE_CLASSES.UPSCALE_DISTRIBUTED).length > 0;
|
||||
|
||||
if (hasCollector || hasDistUpscale) {
|
||||
const hasImageList = findNodesByClass(prompt.output, NODE_CLASSES.IMAGE_LIST_START).length > 0;
|
||||
|
||||
if (hasCollector || hasDistUpscale || hasImageList) {
|
||||
const result = await executeParallelDistributed(extension, prompt);
|
||||
// Immediate status check for instant feedback
|
||||
checkAllWorkerStatuses(extension);
|
||||
@@ -25,12 +27,20 @@ export function setupInterceptor(extension) {
|
||||
export async function executeParallelDistributed(extension, promptWrapper) {
|
||||
const traceExecutionId = `exec_${Date.now()}_${generateUUID().slice(0, 6)}`;
|
||||
try {
|
||||
const enabledWorkers = extension.enabledWorkers;
|
||||
const hasImageList = findNodesByClass(promptWrapper.output, NODE_CLASSES.IMAGE_LIST_START).length > 0;
|
||||
// Image-list v1 uses direct workers only; do not contact paid provider pools.
|
||||
const enabledWorkers = hasImageList
|
||||
? extension.enabledWorkers.filter(worker => worker.type !== "serverless")
|
||||
: extension.enabledWorkers;
|
||||
extension.log(`[exec:${traceExecutionId}] Starting distributed execution`, "debug");
|
||||
|
||||
// Pre-flight health check on all enabled workers
|
||||
const activeWorkers = await performPreflightCheck(extension, enabledWorkers);
|
||||
|
||||
if (hasImageList && activeWorkers.length === 0) {
|
||||
throw new Error("Distributed Image List requires an active direct worker; master fallback is disabled.");
|
||||
}
|
||||
|
||||
// Case: Enabled workers but all offline
|
||||
if (activeWorkers.length === 0 && enabledWorkers.length > 0) {
|
||||
extension.log("No active workers found. All enabled workers are offline.");
|
||||
|
||||
Reference in New Issue
Block a user