Sleep at the end of the cycle, not the beginning.

This commit is contained in:
cls%seawood.org 2004-03-24 01:53:10 +00:00
Родитель 48d2c413b7
Коммит 473ec88076
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -49,24 +49,24 @@ sub LoadConfig() {
sub Run() {
my $start_time = 0;
my $start_time = time();
while (1) {
# $BuildSleep is the minimum amount of time a build is allowed to take.
# It prevents sending too many messages to the tinderbox server when
# something is broken.
my $sleep_time = ($Settings::BuildSleep * 60) - (time() - $start_time);
if ($sleep_time > 0) {
print "\n\nSleeping $sleep_time seconds ...\n";
sleep $sleep_time;
}
$start_time = time();
foreach my $treeentry (@{$Settings::Tinderboxes}) {
chdir($treeentry->{tree}) or
die "Tree $treeentry->{tree} does not exist";
system("./build-seamonkey.pl --once $treeentry->{args}");
chdir("..");
}
my $sleep_time = ($Settings::BuildSleep * 60) - (time() - $start_time);
if ($sleep_time > 0) {
print "\n\nSleeping $sleep_time seconds ...\n";
sleep $sleep_time;
}
$start_time = time();
}
}