From 58cc340339e388bc5db735cfbe6b1c541a9b0c0b Mon Sep 17 00:00:00 2001 From: Kenichi Saito Date: Thu, 9 Apr 2020 01:09:36 +0900 Subject: [PATCH 1/2] If the job is completed before the timeout during the shutdown, make it successful. --- src/worker.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/worker.ts b/src/worker.ts index 99d4a54..43b1544 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -129,13 +129,10 @@ export class Worker { return; } - // 実行中じゃなければシャットダウンが進行中なので、処理を中断する - if (this._isRunning === false) { - this._currentJob = null; + if (this._currentJob === null) { return; } - // ジョブが削除されていれば、処理を中断する if (await this._currentJob.isExist() === false) { this._currentJob = null; return; From a1beeb4d31b231db3a41953b180726401fab4bb2 Mon Sep 17 00:00:00 2001 From: Kenichi Saito Date: Fri, 17 Apr 2020 02:31:41 +0900 Subject: [PATCH 2/2] update dist --- dist/worker.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dist/worker.js b/dist/worker.js index f7d3f53..0f56cd4 100644 --- a/dist/worker.js +++ b/dist/worker.js @@ -92,12 +92,9 @@ class Worker { this._currentJob = null; return; } - // 実行中じゃなければシャットダウンが進行中なので、処理を中断する - if (this._isRunning === false) { - this._currentJob = null; + if (this._currentJob === null) { return; } - // ジョブが削除されていれば、処理を中断する if (await this._currentJob.isExist() === false) { this._currentJob = null; return;