aboutsummaryrefslogtreecommitdiffstats
path: root/ulri
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2018-08-10 10:01:08 +0000
committerPascal Terjan <pterjan@mageia.org>2018-08-10 10:01:08 +0000
commit5e506f5fe70655782d99d376bcde8565e38d4f94 (patch)
tree43473e0f94a1c0f5f49e11c2c2be16ca19ded1f3 /ulri
parent9531f661acc001e0dad7f8888e46950a5ef275aa (diff)
downloadiurt-5e506f5fe70655782d99d376bcde8565e38d4f94.tar
iurt-5e506f5fe70655782d99d376bcde8565e38d4f94.tar.gz
iurt-5e506f5fe70655782d99d376bcde8565e38d4f94.tar.bz2
iurt-5e506f5fe70655782d99d376bcde8565e38d4f94.tar.xz
iurt-5e506f5fe70655782d99d376bcde8565e38d4f94.zip
Only compute timeout once
Diffstat (limited to 'ulri')
-rwxr-xr-xulri5
1 files 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';