From 5e506f5fe70655782d99d376bcde8565e38d4f94 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Fri, 10 Aug 2018 10:01:08 +0000 Subject: Only compute timeout once --- ulri | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ulri b/ulri index ee08226..06742dc 100755 --- a/ulri +++ b/ulri @@ -276,7 +276,8 @@ foreach my $prefix (keys %pkg_tree) { my $status_file = "$prefix_dir/log/status.log"; plog('INFO', "check status: $host/$arch ($bot [$pid])"); - my $timeout = (time()-$time) > $config->{faildelay}; + my $seconds = time()-$time; + my $timeout = $seconds > $config->{faildelay}; my $status = sout($remote, "cat $status_file"); if ($? == 255) { plog('WARN', "failed to get status for $host/$arch"); @@ -289,10 +290,8 @@ foreach my $prefix (keys %pkg_tree) { if (!$status) { # Need to differenciate process not running with failure to ssh chomp($proc_state = sout($remote, "ps h -o state $pid || echo NOT_RUNNING")); - my $seconds = time()-$time; # Reasons for failure - my $timeout = $seconds > $config->{faildelay}; my $zombie = $proc_state eq 'Z'; my $ended = $proc_state eq 'NOT_RUNNING'; -- cgit v1.2.1