]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Allow to set 0 as Maximum Job Error Count
authorMichal Rakowski <michal.rakowski@baculasystems.com>
Wed, 27 Jan 2021 11:41:09 +0000 (12:41 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:59 +0000 (09:02 +0100)
This allows job to run no matter how many error there is.

bacula/src/filed/backup.c

index d5a58a8af3ff1d31a94537e5f65b9c5f70ef3ac6..7fae57176c3fa55e4675255a5cdc949edbdc5f44 100644 (file)
@@ -713,7 +713,8 @@ finish_sending:
       berrno be;
       Jmsg(jcr, M_ERROR, 0, _("Read error on file %s. ERR=%s\n"),
          bctx.ff_pkt->snap_fname, be.bstrerror(bctx.ff_pkt->bfd.berrno));
-      if (jcr->JobErrors++ > me->max_job_errors) {       /* insanity check */
+      /* It's possible for user to set max job errors to 0 as an infinite value */
+      if (me->max_job_errors && (jcr->JobErrors++ > me->max_job_errors)) {       /* insanity check */
          Jmsg(jcr, M_FATAL, 0, _("Too many errors. JobErrors=%d.\n"), jcr->JobErrors);
       }
    } else if (bctx.ff_pkt->flags & FO_ENCRYPT) {