Skip to content

Commit e296b76

Browse files
ehooiintcreator
andauthored
feat: Allow awaiting job.stop() (#977)
<!--- Provide a general summary of your changes in the Title above (following the Conventional Commits standard) --> <!-- More infos: https://www.conventionalcommits.org --> <!-- Commit types: https://github.com/insurgent-lab/conventional-changelog-preset#commit-types--> ## Description I believe this would be useful for building a job manager (see: #871) and supporting graceful shutdown (see: #713). ## Related Issue #976 ## Motivation and Context <!--- Why is this change required? What problem does it solve? --> ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## Screenshots (if appropriate): ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. - [ ] If my change introduces a breaking change, I have added a `!` after the type/scope in the title (see the Conventional Commits standard). Co-authored-by: Brandon der Blätter <intcreator@users.noreply.github.com>
1 parent 6a355a3 commit e296b76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/job.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ export class CronJob<OC extends CronOnCompleteCommand | null = null, C = null> {
354354
return;
355355
}
356356

357-
void Promise.resolve().then(async () => {
357+
return Promise.resolve().then(async () => {
358358
await this._waitForJobCompletion();
359359
await this._executeOnComplete();
360360
});

0 commit comments

Comments
 (0)