K6CGDFOTL2YODZPNT36RKQ3JW435323R52LLNWW4XELWR4JRDH3AC
bool shouldEvaluate(Jobset & jobset)
{
if (jobset.pid != -1) {
// Already running.
return false;
}
if (jobset.triggerTime == std::numeric_limits<time_t>::max()) {
// An evaluation of this Jobset is requested
return true;
}
if (jobset.checkInterval <= 0) {
// Automatic scheduling is disabled. We allow requested
// evaluations, but never schedule start one.
return false;
}
if (jobset.lastCheckedTime + jobset.checkInterval <= time(0)) {
// Time to schedule a fresh evaluation
return true;
}
return false;
}