perf: streamline repository and deployment awareness
ForgeFlow quality gate / quality (push) Canceled after 0s
ForgeFlow quality gate / quality (push) Canceled after 0s
This commit is contained in:
@@ -59,18 +59,23 @@ function createUnraidStateMethods({ path, bash, shellQuote, inventoryRemoteIdent
|
||||
return "";
|
||||
}
|
||||
};
|
||||
const health = await this.checkHealth(profile.healthcheckUrl);
|
||||
const containerRunning = fields.containerRunning === "true";
|
||||
const health = containerRunning
|
||||
? await this.checkHealth(profile.healthcheckUrl)
|
||||
: { configured: false, healthy: false, skipped: "container-stopped" };
|
||||
const dockerHealthy = fields.dockerHealth
|
||||
? fields.dockerHealth === "healthy"
|
||||
: null;
|
||||
const effectiveHealthy = health.configured ? health.healthy : dockerHealthy;
|
||||
const runtimeVerification = health.configured
|
||||
const effectiveHealthy = !containerRunning ? false : health.configured ? health.healthy : dockerHealthy;
|
||||
const runtimeVerification = !containerRunning
|
||||
? "stopped"
|
||||
: health.configured
|
||||
? "desktop-healthcheck"
|
||||
: dockerHealthy === true
|
||||
? "docker-healthcheck"
|
||||
: dockerHealthy === false
|
||||
? "docker-unhealthy"
|
||||
: fields.containerRunning === "true"
|
||||
: containerRunning
|
||||
? "running-unverified"
|
||||
: "stopped";
|
||||
return this.store.saveDeploymentState(profile.id, {
|
||||
@@ -85,7 +90,7 @@ function createUnraidStateMethods({ path, bash, shellQuote, inventoryRemoteIdent
|
||||
healthStatus: health.status,
|
||||
healthLatencyMs: health.latencyMs,
|
||||
containerName,
|
||||
containerRunning: fields.containerRunning === "true",
|
||||
containerRunning,
|
||||
dockerHealth: fields.dockerHealth || null,
|
||||
dockerMan: {
|
||||
webUi: decode(fields.webUiLabel),
|
||||
@@ -273,7 +278,16 @@ function createUnraidStateMethods({ path, bash, shellQuote, inventoryRemoteIdent
|
||||
item.status,
|
||||
),
|
||||
);
|
||||
return Promise.all(active.map((item) => this.refreshOperation(item.id)));
|
||||
const queue = [...active];
|
||||
const results = [];
|
||||
const workers = Array.from({ length: Math.min(4, queue.length) }, async () => {
|
||||
while (queue.length) {
|
||||
const operation = queue.shift();
|
||||
results.push(await this.refreshOperation(operation.id));
|
||||
}
|
||||
});
|
||||
await Promise.all(workers);
|
||||
return results;
|
||||
}
|
||||
}
|
||||
return UnraidStateMethods.prototype;
|
||||
|
||||
Reference in New Issue
Block a user