ttime = jr->EndTime;
(void)localtime_r(&ttime, &tm);
strftime(dt, sizeof(dt), "%Y-%m-%d %H:%M:%S", &tm);
-
- if (jr->RealEndTime == 0) {
+
+ if (jr->RealEndTime == 0 || jr->RealEndTime < jr->EndTime) {
jr->RealEndTime = jr->EndTime;
}
ttime = jr->RealEndTime;
if (jcr->wasVirtualFull) {
jcr->setJobLevel(L_VIRTUAL_FULL);
}
+ /*
+ * When we are using the same jcr then make sure to reset
+ * RealEndTime back to zero.
+ */
+ jcr->jr.RealEndTime = 0;
jobq_add(jq, jcr); /* queue the job to run again */
P(jq->mutex);
free_jcr(jcr); /* release jcr */