Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes job scheduling using
when
parameter (bypython-dateutil
).Updates docs about all supported scheduler options.
What issues does this PR fix or reference?
Fixes #34873
Previous Behavior
The reason for the
when
option doesn't work is that Salt expects when it wakes up from waiting interval loop and the time has come to execute the scheduled function, there must be exactly the same moment to do so -- literally0
seconds
until job need to be run.If such moment got missed, i.e. Salt woke up after the exact time for function to be run (desired time now is the past for a number of seconds), the job would be discarded.
New Behavior
If Salt is waiting for the scheduled job should be run in some future (
data['_when_run']
set toTrue
) and it discovers that time is already passed (seconds
became less than0
), then the job run will be triggered. During the next iteration the same job will be skipped till Salt will evaluatedateutil
expression to set the scheduled event in the future again.Tests written?
No