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,6 +42,7 @@ class ImageWorker extends BaseServiceWorker {
|
|||
|
||||
async getRunning() {
|
||||
const statuses = [];
|
||||
if (process.env.API === "true") {
|
||||
for (const [address, connection] of this.connections) {
|
||||
if (connection.conn.readyState !== 0 && connection.conn.readyState !== 1) {
|
||||
continue;
|
||||
|
@ -52,6 +53,7 @@ class ImageWorker extends BaseServiceWorker {
|
|||
max: connection.max
|
||||
});
|
||||
}
|
||||
}
|
||||
return statuses;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue