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 wrong lastRunFinishedTooLate behaviour when lastStartedAt and lastFinishedAt are within a second because of a very fast task #109

Merged
merged 1 commit into from
Mar 28, 2024
Merged

Fix wrong lastRunFinishedTooLate behaviour when lastStartedAt and lastFinishedAt are within a second because of a very fast task #109

merged 1 commit into from
Mar 28, 2024

Conversation

mathiasmoser
Copy link

I have also added a test case to guarantee that this edge case of 2 equal dates for last start and end date is working properly.

The main problem was that the subSecond() call on the $lastFinishedAt only makes sense when it is not the actual lastRunFinishedAt date - so i moved the subSecond() call up to the "fallback" when using the created_at date.

…tFinishedAt Dates are within a second. Add Test to guarantee correct handling of this edge case.
@mathiasmoser mathiasmoser changed the title Fix wrong lastRunFinishedTooLate behaviour when lastStartedAt and lastFinishedAt are within a second because of very fast tasks Fix wrong lastRunFinishedTooLate behaviour when lastStartedAt and lastFinishedAt are within a second because of a very fast task Mar 26, 2024
@freekmurze freekmurze merged commit 51e9f00 into spatie:main Mar 28, 2024
12 checks passed
@freekmurze
Copy link
Member

Thank you!

@mathiasmoser mathiasmoser deleted the fix-task-last-run-finished-too-late-logic branch March 28, 2024 18:02
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