Skip to content
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

fix(job-scheduler): avoid duplicates when upserting in a quick sequence #2991

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

manast
Copy link
Contributor

@manast manast commented Dec 31, 2024

Why

This PR fixes this issue: #2988

How

This PR makes sure that the "nextMillis" portion of every repeatable jobs is always calculated on well defined so called "time slots". The offset is only used to calculate the "delay" option of the repeatable job so that it repeats at the appropriate time, but is not used for the "nextMillis" calculation anymore.

@manast manast requested review from roggervalf and fgozdz and removed request for roggervalf December 31, 2024 16:38
Copy link
Collaborator

@roggervalf roggervalf left a comment

Choose a reason for hiding this comment

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

Lgtm, only one styled comment

beforeEach(async function () {
const date = new Date('2017-02-07 9:24:00');
this.clock.setSystemTime(date);
worker = new Worker(
Copy link
Collaborator

Choose a reason for hiding this comment

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

beforeEach and afterEach in this describe block is only affecting one test, they can be placed inside that test

@roggervalf roggervalf force-pushed the fix/multiple-delayed-jobs-upserting-succession branch from 2c967b7 to 975656a Compare December 31, 2024 19:53
@roggervalf roggervalf merged commit e8cdb99 into master Dec 31, 2024
12 checks passed
@roggervalf roggervalf deleted the fix/multiple-delayed-jobs-upserting-succession branch December 31, 2024 20:14
github-actions bot pushed a commit that referenced this pull request Dec 31, 2024
## [5.34.6](v5.34.5...v5.34.6) (2024-12-31)

### Bug Fixes

* **job-scheduler:** avoid duplicates when upserting in a quick sequence ([#2991](#2991)) ([e8cdb99](e8cdb99))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants