Make sure imstat doesn't break if the image API isn't used
This commit is contained in:
parent
24b828ccf6
commit
8b238a2316
1 changed files with 10 additions and 8 deletions
|
@ -42,15 +42,17 @@ class ImageWorker extends BaseServiceWorker {
|
||||||
|
|
||||||
async getRunning() {
|
async getRunning() {
|
||||||
const statuses = [];
|
const statuses = [];
|
||||||
for (const [address, connection] of this.connections) {
|
if (process.env.API === "true") {
|
||||||
if (connection.conn.readyState !== 0 && connection.conn.readyState !== 1) {
|
for (const [address, connection] of this.connections) {
|
||||||
continue;
|
if (connection.conn.readyState !== 0 && connection.conn.readyState !== 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
statuses.push({
|
||||||
|
address,
|
||||||
|
runningJobs: connection.njobs,
|
||||||
|
max: connection.max
|
||||||
|
});
|
||||||
}
|
}
|
||||||
statuses.push({
|
|
||||||
address,
|
|
||||||
runningJobs: connection.njobs,
|
|
||||||
max: connection.max
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return statuses;
|
return statuses;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue