diff --git a/kstars/ekos/scheduler/scheduler.cpp b/kstars/ekos/scheduler/scheduler.cpp --- a/kstars/ekos/scheduler/scheduler.cpp +++ b/kstars/ekos/scheduler/scheduler.cpp @@ -1144,13 +1144,12 @@ } // In case of a repeating jobs, let's make sure we have more runs left to go - /* FIXME: if finding a repeated job with no repeats remaining, state this is a safeguard - Is it really? Set complete? */ if (job->getCompletionCondition() == SchedulerJob::FINISH_REPEAT) { if (job->getRepeatsRemaining() == 0) { appendLogText(i18n("Job '%1' has no more batches remaining.", job->getName())); - job->setState(SchedulerJob::JOB_INVALID); + job->setState(SchedulerJob::JOB_EVALUATION); continue; } } @@ -3941,7 +3940,8 @@ } else if (currentJob->getCompletionCondition() == SchedulerJob::FINISH_REPEAT) { - currentJob->setRepeatsRemaining(currentJob->getRepeatsRemaining() - 1); + if (0 < currentJob->getRepeatsRemaining()) + currentJob->setRepeatsRemaining(currentJob->getRepeatsRemaining() - 1); // If we're done if (currentJob->getRepeatsRemaining() == 0) @@ -3962,6 +3962,7 @@ else { /* FIXME: raise priority to allow other jobs to schedule in-between */ + executeJob(currentJob); /* If we are guiding, continue capturing */ if (currentJob->getStepPipeline() & SchedulerJob::USE_GUIDE) @@ -3991,6 +3992,8 @@ } else if (currentJob->getCompletionCondition() == SchedulerJob::FINISH_LOOP) { + executeJob(currentJob); + currentJob->setStage(SchedulerJob::STAGE_CAPTURING); captureBatch++; startCapture(); @@ -4019,6 +4022,8 @@ } else { + executeJob(currentJob); + currentJob->setStage(SchedulerJob::STAGE_CAPTURING); captureBatch++; startCapture();