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

Check that the new nextRunAt is different that the previous nextRunAt… #863

Conversation

@RaphaelRheault
Copy link
Contributor

RaphaelRheault commented Oct 4, 2019

Fixing the issue with (#858)
When the lastJobAt is before the nextRunAt, the cronTab gives a nextRunAt at the same value as the previous one, making it run twice for the same period.

Ex.: In this case, it ran twice for the 13:25 timeframe.

Starting job (lastRunAt): 2019-10-04T13:24:00.001Z (nextRunAt): 2019-10-04T13:25:00.000Z
Starting job (lastRunAt): 2019-10-04T13:24:59.999Z (nextRunAt): 2019-10-04T13:25:00.000Z
Starting job (lastRunAt): 2019-10-04T13:25:00.070Z (nextRunAt): 2019-10-04T13:26:00.000Z
Starting job (lastRunAt): 2019-10-04T13:26:00.003Z (nextRunAt): 2019-10-04T13:27:00.000Z

Added an extra condition where the cronTime was validated to also make sure it's not the same as the previous nextRunAt.

@RaphaelRheault RaphaelRheault force-pushed the RaphaelRheault:update/check-nextDate-equals-previous-nextRunAt branch from d4a9530 to ef0b525 Dec 10, 2019
@RaphaelRheault RaphaelRheault force-pushed the RaphaelRheault:update/check-nextDate-equals-previous-nextRunAt branch from 71ea541 to 109e375 Dec 10, 2019
Copy link
Contributor

koresar left a comment

Looks perfect. :)
Sorry for the delay.

@koresar koresar merged commit 10c9773 into agenda:master Dec 16, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
security/snyk - package.json (agenda) No manifest changes detected
@simison

This comment has been minimized.

Copy link
Member

simison commented Dec 20, 2019

Could someone add a changelog item for this under "Next"? https://github.com/agenda/agenda/blob/10c977329405a18cffac4fd41f1e65644487e983/History.md

@koresar

This comment has been minimized.

Copy link
Contributor

koresar commented Dec 20, 2019

I'm on a no-laptop holiday until January 2nd...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.