зеркало из https://github.com/mozilla/pjs.git
Sleep at the end of the cycle, not the beginning.
This commit is contained in:
Родитель
48d2c413b7
Коммит
473ec88076
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче