From 1aa2d4a916ea3a1b0f573e935f435f7ebcf31cb1 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 14 Oct 2020 13:59:17 +0200 Subject: [PATCH] fix: add job name again stats output --- package.json | 6 +++--- src/JobProcessor.ts | 13 +++++++++---- tsconfig.json | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 4cd2584..5f7e9e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hokify/agenda", - "version": "4.0.13", + "version": "4.0.16", "description": "Light weight job scheduler for Node.js", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -32,7 +32,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/@hokify/agenda" + "url": "git://github.com/hokify/agenda" }, "keywords": [ "job", @@ -45,7 +45,7 @@ "author": "Ryan Schmukler (http://slingingcode.com/)", "license": "MIT", "bugs": { - "url": "https://github.com/@hokify/agenda/issues" + "url": "https://github.com/hokify/agenda/issues" }, "dependencies": { "cron": "~1.8.2", diff --git a/src/JobProcessor.ts b/src/JobProcessor.ts index d7c4c30..248f78a 100644 --- a/src/JobProcessor.ts +++ b/src/JobProcessor.ts @@ -34,10 +34,15 @@ export class JobProcessor { maxConcurrency: this.maxConcurrency, processEvery: this.processEvery }, - jobStatus: Object.keys(this.jobStatus).map(job => ({ - ...this.jobStatus[job], - config: this.agenda.definitions[job] - })), + jobStatus: Object.fromEntries( + Object.keys(this.jobStatus).map(job => [ + job, + { + ...this.jobStatus[job], + config: this.agenda.definitions[job] + } + ]) + ), runningJobs: !fullDetails ? this.runningJobs.length : this.runningJobs, lockedJobs: !fullDetails ? this.lockedJobs.length : this.lockedJobs, jobsToLock: !fullDetails ? this.jobsToLock.length : this.jobsToLock, diff --git a/tsconfig.json b/tsconfig.json index 60d61ee..32172ed 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,8 +5,8 @@ // target settings for node 10 "module": "commonjs", - "target": "es2018", - "lib": ["es2018"], + "target": "es2019", + "lib": ["es2019"], // "lib": ["esnext", "esnext.asynciterable", "dom"], // other best practice configs