src/dird/job.c
static bool job_check_maxruntime(JCR *jcr)
{
   bool cancel = false;
   JOB *job = jcr->job;
   utime_t run_time;

   if (job_canceled(jcr) || !jcr->job_started) {
      return false;
   }
   if (jcr->job->MaxRunTime == 0 && job->FullMaxRunTime == 0 &&
       job->IncMaxRunTime == 0 && job->DiffMaxRunTime == 0) {
      return false;
   }
   run_time = watchdog_time - jcr->start_time;
   Dmsg7(200, "check_maxruntime %llu-%u=%llu >= %llu|%llu|%llu|%llu\n",
         watchdog_time, jcr->start_time, run_time, job->MaxRunTime, job->FullMaxRunTime,
         job->IncMaxRunTime, job->DiffMaxRunTime);

   if (jcr->getJobLevel() == L_FULL && job->FullMaxRunTime != 0 &&
         run_time >= job->FullMaxRunTime) {
      Dmsg0(200, "check_maxwaittime: FullMaxcancel\n");
      cancel = true;
   } else if (jcr->getJobLevel() == L_DIFFERENTIAL && job->DiffMaxRunTime != 0 &&
         run_time >= job->DiffMaxRunTime) {
      Dmsg0(200, "check_maxwaittime: DiffMaxcancel\n");
      cancel = true;
   } else if (jcr->getJobLevel() == L_INCREMENTAL && job->IncMaxRunTime != 0 &&
         run_time >= job->IncMaxRunTime) {
      Dmsg0(200, "check_maxwaittime: IncMaxcancel\n");
      cancel = true;
   } else if (job->MaxRunTime > 0 && run_time >= job->MaxRunTime) {
      Dmsg0(200, "check_maxwaittime: Maxcancel\n");
      cancel = true;
   }

   return cancel;
}
/*
 * Check if maxruntime has expired and if the job can be
 *   canceled.
 */
Check if maxruntime has expired and if the job can be
canceled.
Check if maxruntime has expired and if the job can be canceled .
static bool job_check_maxruntime(JCR *jcr)
{
   bool cancel = false;
   JOB *job = jcr->job;
   utime_t run_time;
   if (job_canceled(jcr) || !jcr->job_started) {
      return false;
   }
   if (jcr->job->MaxRunTime == 0 && job->FullMaxRunTime == 0 &&
       job->IncMaxRunTime == 0 && job->DiffMaxRunTime == 0) {
      return false;
   }
   run_time = watchdog_time - jcr->start_time;
   Dmsg7(200, "check_maxruntime %llu-%u=%llu >= %llu|%llu|%llu|%llu\n",
         watchdog_time, jcr->start_time, run_time, job->MaxRunTime, job->FullMaxRunTime,
         job->IncMaxRunTime, job->DiffMaxRunTime);
   if (jcr->getJobLevel() == L_FULL && job->FullMaxRunTime != 0 &&
         run_time >= job->FullMaxRunTime) {
      Dmsg0(200, "check_maxwaittime: FullMaxcancel\n");
      cancel = true;
   } else if (jcr->getJobLevel() == L_DIFFERENTIAL && job->DiffMaxRunTime != 0 &&
         run_time >= job->DiffMaxRunTime) {
      Dmsg0(200, "check_maxwaittime: DiffMaxcancel\n");
      cancel = true;
   } else if (jcr->getJobLevel() == L_INCREMENTAL && job->IncMaxRunTime != 0 &&
         run_time >= job->IncMaxRunTime) {
      Dmsg0(200, "check_maxwaittime: IncMaxcancel\n");
      cancel = true;
   } else if (job->MaxRunTime > 0 && run_time >= job->MaxRunTime) {
      Dmsg0(200, "check_maxwaittime: Maxcancel\n");
      cancel = true;
   }
   return cancel;
}
static bool job_check_maxruntime ( JCR * jcr ) { bool cancel = false ; JOB * job = jcr -> job ; utime_t run_time ; if ( job_canceled ( jcr ) || ! jcr -> job_started ) { return false ; } if ( jcr -> job -> MaxRunTime == 0 && job -> FullMaxRunTime == 0 && job -> IncMaxRunTime == 0 && job -> DiffMaxRunTime == 0 ) { return false ; } run_time = watchdog_time - jcr -> start_time ; Dmsg7 ( 200 , " \n " , watchdog_time , jcr -> start_time , run_time , job -> MaxRunTime , job -> FullMaxRunTime , job -> IncMaxRunTime , job -> DiffMaxRunTime ) ; if ( jcr -> getJobLevel ( ) == L_FULL && job -> FullMaxRunTime != 0 && run_time >= job -> FullMaxRunTime ) { Dmsg0 ( 200 , " \n " ) ; cancel = true ; } else if ( jcr -> getJobLevel ( ) == L_DIFFERENTIAL && job -> DiffMaxRunTime != 0 && run_time >= job -> DiffMaxRunTime ) { Dmsg0 ( 200 , " \n " ) ; cancel = true ; } else if ( jcr -> getJobLevel ( ) == L_INCREMENTAL && job -> IncMaxRunTime != 0 && run_time >= job -> IncMaxRunTime ) { Dmsg0 ( 200 , " \n " ) ; cancel = true ; } else if ( job -> MaxRunTime > 0 && run_time >= job -> MaxRunTime ) { Dmsg0 ( 200 , " \n " ) ; cancel = true ; } return cancel ; }
Check if maxruntime has expired and if the job can be
   canceled.
Check if maxruntime has expired and if the job can be canceled .