From 3dd9da886489a73166141aef66f96b01efe7cdaf Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Fri, 5 Mar 2021 00:45:18 +0300 Subject: jobd: status format update --- src/jobd.js | 2 +- src/lib/worker.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/jobd.js b/src/jobd.js index 298d769..477934f 100755 --- a/src/jobd.js +++ b/src/jobd.js @@ -190,7 +190,7 @@ function onStatus(data, requestNo, connection) { connection.send( new ResponseMessage(requestNo) .setData({ - queue: qs, + targets: qs.targets, jobPromisesCount: Object.keys(jobPromises).length, memoryUsage: process.memoryUsage() }) diff --git a/src/lib/worker.js b/src/lib/worker.js index b09c2f8..562e0b1 100644 --- a/src/lib/worker.js +++ b/src/lib/worker.js @@ -145,10 +145,13 @@ class Worker extends EventEmitter { let status = {targets: {}} for (const targetName in this.targets) { let target = this.targets[targetName] - status.targets[targetName] = {} + status.targets[targetName] = { + paused: target.paused, + slots: {} + } for (const slotName in target.slots) { const queue = target.slots[slotName] - status.targets[targetName][slotName] = { + status.targets[targetName].slots[slotName] = { concurrency: queue.concurrency, length: queue.length, } -- cgit v1.2.3