Skip to content

Commit

Permalink
Merge pull request #19 from hajipy/change_shutdown_behavior
Browse files Browse the repository at this point in the history
If the job is completed before the timeout during the shutdown, make it successful.
  • Loading branch information
hajipy authored Apr 16, 2020
2 parents fca4317 + a1beeb4 commit 8807771
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions dist/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8807771

Please sign in to comment.