mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
28.52.2018 9e49542cbb5180ef95645926bc7f64b3d5684ad0
borgbutler-core/src/main/java/de/micromata/borgbutler/jobs/AbstractJob.java
@@ -36,6 +36,17 @@
            this.status = Status.CANCELLED;
        }
        this.cancelledRequested = true;
        cancelRunningProcess();
    }
    protected void setCancelled() {
        this.status = Status.CANCELLED;
    }
    /**
     * Not supported if not implemented.
     */
    protected void cancelRunningProcess() {
    }
    /**
@@ -52,6 +63,10 @@
    }
    protected void failed() {
        if (this.status == Status.CANCELLED) {
            // do nothing. It's normal that cancelled jobs fail.
            return;
        }
        if (this.status != Status.RUNNING) {
            logger.error("Internal error, illegal state! You shouldn't set the job status to FAILED if not in status RUNNING: " + this.status);
        }