[pve-devel] [PATCH pve-manager 10/18] PVE::Replication::run_jobs - fix job start time

Dietmar Maurer dietmar at proxmox.com
Tue May 23 09:08:49 CEST 2017


Value $now is ment for use inside regression tests. Normally
a job should get the actual start time.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/Replication.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/PVE/Replication.pm b/PVE/Replication.pm
index f273cda3..7bfdeb7d 100644
--- a/PVE/Replication.pm
+++ b/PVE/Replication.pm
@@ -259,11 +259,10 @@ sub run_jobs {
     my ($now, $logfunc) = @_; # useful for regression testing
 
     my $code = sub {
-	$now //= time();
-
 	my $stateobj = $read_state->();
 
 	while (my $jobcfg = $get_next_job->($stateobj, $now)) {
+	    my $start_time = $now // time();
 	    $run_replication->($stateobj, $jobcfg, $now, $logfunc);
 	}
     };
-- 
2.11.0




More information about the pve-devel mailing list