- if (jcr->job->RescheduleOnError &&
- jcr->JobStatus != JS_Terminated &&
- jcr->JobStatus != JS_Canceled &&
- jcr->getJobType() == JT_BACKUP &&
- (jcr->job->RescheduleTimes == 0 ||
- jcr->reschedule_count < jcr->job->RescheduleTimes)) {
+ /* Basic condition is that more times remain */
+ if (jcr->job->RescheduleTimes == 0 ||
+ jcr->reschedule_count < jcr->job->RescheduleTimes) {
+ resched =
+ /* Check for incomplete jobs */
+ (jcr->job->RescheduleIncompleteJobs && jcr->is_incomplete()) ||
+ /* Check for failed jobs */
+ (jcr->job->RescheduleOnError &&
+ jcr->JobStatus != JS_Terminated &&
+ jcr->JobStatus != JS_Canceled &&
+ jcr->getJobType() == JT_BACKUP);
+ }
+ if (resched) {