From 92a243e986559c9d0316a238f23bb240bd2788ee Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 27 Jun 2017 11:41:44 +0200 Subject: [PATCH] PVE::ReplicationState - cleanup job state on job removal Signed-off-by: Dietmar Maurer --- PVE/ReplicationState.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/PVE/ReplicationState.pm b/PVE/ReplicationState.pm index eeab4e8..5401db6 100644 --- a/PVE/ReplicationState.pm +++ b/PVE/ReplicationState.pm @@ -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 { -- 2.39.2