Hitting a constraint sets a job to IDLE instead of COMPLETE so that it might be restarted later
Summary: Adding the error handling strategy caused a regression such that running jobs where a constraint is not met are nevertheless restarted. Additionally, setting them to "COMPLETED" as soon as a constraint is not met, is misleading. With this diff, jobs are set to state IDLE as soon as a constraint is no longer met. Jobs where a constraint is not met are scheduled to a future date where the constraint is met again.
Test Plan:
Test case #1: Create a job with a constraint - e.g. the altitude - is met and that is infinitely repeated. Start the job and check whether
- the job is postponed as soon as the constraint is not longer valid
- as soon as the constraint is valid again, the job is restarted
Test case #2: Add a job in front of the job from test case #1 that is only executed once. Start the schedule and check that the completed job will not be restarted as soon as the scheduler wakes up.
Reviewers: TallFurryMan, mutlaqja
Reviewed By: TallFurryMan, mutlaqja
Subscribers: kde-edu
Tags: KDE Edu
Differential Revision: https://phabricator.kde.org/D24232