Skip to content

fix: prevent jobs from stopping unexpectedly #963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 6, 2025

Conversation

sheerlox
Copy link
Collaborator

@sheerlox sheerlox commented Feb 23, 2025

Description

See #962.

Related Issue

Closes #962.

Motivation and Context

See #962.

How Has This Been Tested?

New test case added.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • 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).

@sheerlox sheerlox added the type:bug Bug reports and bug fixes label Feb 23, 2025
@sheerlox sheerlox marked this pull request as ready for review April 6, 2025 10:39
@sheerlox sheerlox changed the base branch from main to beta April 6, 2025 10:41
@sheerlox sheerlox requested review from Copilot and intcreator April 6, 2025 10:41
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

tests/threshold.test.ts:49

  • Consider restoring the fake timers using clock.restore() in an afterEach block to ensure that timer state does not leak between tests.
const clock = sinon.useFakeTimers();

tests/cron.test.ts:40

  • Ensure that fake timers are restored (using clock.restore()) after the test completes to avoid side effects in subsequent tests.
const clock = sinon.useFakeTimers();

Copy link
Collaborator

@intcreator intcreator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a couple of small notes that aren't a huge deal. I would say maybe we want wording that calls out the options to change the threshold more directly but I think most people just will be happy that the jobs don't stop executing because of this bug so it's fine

@sheerlox sheerlox merged commit 69d2ef5 into kelektiv:beta Apr 6, 2025
16 of 17 checks passed
@sheerlox sheerlox deleted the fix/962/job-stopping-unexpectedly branch April 6, 2025 16:00
@ncb000gt
Copy link
Member

ncb000gt commented Apr 6, 2025

🎉 This PR is included in version 4.1.5-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ncb000gt
Copy link
Member

🎉 This PR is included in version 4.2.1-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

intcreator added a commit that referenced this pull request Apr 15, 2025
…980)

<!--- 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

<!--- Describe your changes in detail -->
see #963 

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->
fixes #962

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->
see #962

## 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. -->
see #963 

## 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.
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.
- [x] 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: Pierre Cavin <me@sherlox.io>
Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
intcreator pushed a commit to WillianAgostini/node-cron that referenced this pull request Apr 18, 2025
## [4.3.0](kelektiv/node-cron@v4.2.0...v4.3.0) (2025-04-15)

### ✨ Features

* add options to handle cases where jobs could stop unexpectedly ([kelektiv#980](kelektiv#980)) ([994b93a](kelektiv@994b93a)), closes [kelektiv#963](kelektiv#963) [kelektiv#962](kelektiv#962) [kelektiv#962](kelektiv#962) [kelektiv#963](kelektiv#963)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @beta type:bug Bug reports and bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jobs stopping unexpectedly
3 participants