summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-03-05 00:45:18 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-03-05 00:45:18 +0300
commit3dd9da886489a73166141aef66f96b01efe7cdaf (patch)
tree2c5ad40496d58a2d13bf267c8bca8b3aed8bb52d
parenta36dd3d5db39a9300a1801b1df9bdf4925aa074c (diff)
jobd: status format update
-rwxr-xr-xsrc/jobd.js2
-rw-r--r--src/lib/worker.js7
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,
}