     case JS_WaitMaxJobs:
     case JS_WaitPriority:
 -       set_waittime = false;    /* keep old time */
-+      if (!enter_in_waittime) {
++      if (!enter_in_waittime) { /* we get out the wait time */
 +         jcr->wait_time_sum += (time(NULL) - jcr->wait_time);
 +         jcr->wait_time = 0;
 +      }

    POOLMEM *stime;                    /* start time for incremental/differential */
Index: src/lib/jcr.c
===================================================================
--- src/lib/jcr.c	(révision 7929)
+++ src/lib/jcr.c	(copie de travail)
@@ -738,41 +738,29 @@
    return priority;
 }

Index: src/dird/job.c
===================================================================
--- src/dird/job.c	(revision 7939)
+++ src/dird/job.c	(working copy)
@@ -549,9 +549,10 @@
    if (!job_waiting(jcr)) {
       return false;
    }
-   Dmsg3(200, "check maxwaittime %u - %u >= %u\n", watchdog_time, jcr->wait_time, job->MaxWaitTime);
-   if (job->MaxWaitTime != 0 &&
-       (watchdog_time - jcr->wait_time) >= job->MaxWaitTime) {
+   Dmsg3(200, "check maxwaittime %u - %u >= %u\n", 
+         (watchdog_time - jcr->wait_time), jcr->wait_time, job->MaxWaitTime);
+   if (job->MaxWaitTime != 0 && jcr->wait_time != 0 &&
+       (watchdog_time - jcr->wait_time + jcr->wait_time_sum) >= job->MaxWaitTime) {
       cancel = true;
    }
 
Index: src/jcr.h
===================================================================
--- src/jcr.h	(revision 7939)
+++ src/jcr.h	(working copy)
@@ -216,7 +216,8 @@
    time_t start_time;                 /* when job actually started */
    time_t run_time;                   /* used for computing speed */
