Make sure imstat doesn't break if the image API isn't used

This commit is contained in:
Essem 2022-01-16 20:12:54 -06:00
parent 24b828ccf6
commit 8b238a2316
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -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;
}