diff options
author | Pascal Terjan <pterjan@mageia.org> | 2018-08-10 10:01:08 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2018-08-10 10:01:08 +0000 |
commit | 5e506f5fe70655782d99d376bcde8565e38d4f94 (patch) | |
tree | 43473e0f94a1c0f5f49e11c2c2be16ca19ded1f3 | |
parent | 9531f661acc001e0dad7f8888e46950a5ef275aa (diff) | |
download | iurt-5e506f5fe70655782d99d376bcde8565e38d4f94.tar iurt-5e506f5fe70655782d99d376bcde8565e38d4f94.tar.gz iurt-5e506f5fe70655782d99d376bcde8565e38d4f94.tar.bz2 iurt-5e506f5fe70655782d99d376bcde8565e38d4f94.tar.xz iurt-5e506f5fe70655782d99d376bcde8565e38d4f94.zip |
Only compute timeout once
-rwxr-xr-x | ulri | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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'; |