]> git.proxmox.com Git - pve-guest-common.git/commitdiff
PVE::ReplicationState - cleanup job state on job removal
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 27 Jun 2017 09:41:44 +0000 (11:41 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 27 Jun 2017 09:53:28 +0000 (11:53 +0200)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
PVE/ReplicationState.pm

index eeab4e8aedeadb9e043087cddb3104d4a1a781bb..5401db60f9dbb9f2df9189069a0c0cc2cfc84bcd 100644 (file)
@@ -158,12 +158,17 @@ sub record_job_end {
        chomp $err;
        $state->{fail_count}++;
        $state->{error} = "$err";
+       write_job_state($jobcfg,  $state);
     } else {
-       $state->{last_sync} = $start_time;
-       $state->{fail_count} = 0;
-       delete $state->{error};
+       if ($jobcfg->{remove_job}) {
+           write_job_state($jobcfg, undef);
+       } else {
+           $state->{last_sync} = $start_time;
+           $state->{fail_count} = 0;
+           delete $state->{error};
+           write_job_state($jobcfg,  $state);
+       }
     }
-    write_job_state($jobcfg,  $state);
 }
 
 sub replication_snapshot_name {