in trim_db() localize @run_times @dead_times and remove

columns which are not currently recieving data.
This commit is contained in:
kestes%walrus.com 2002-05-06 21:53:57 +00:00
Родитель 3eac9ac574
Коммит 48416ed57d
1 изменённых файлов: 20 добавлений и 5 удалений

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

@ -7,8 +7,8 @@
# the build was and display a link to the build log. # the build was and display a link to the build log.
# $Revision: 1.47 $ # $Revision: 1.48 $
# $Date: 2002-05-06 20:45:18 $ # $Date: 2002-05-06 21:53:57 $
# $Author: kestes%walrus.com $ # $Author: kestes%walrus.com $
# $Source: /home/jrmuizel/cvs-mirror/mozilla/webtools/tinderbox2/src/lib/TinderDB/Build.pm,v $ # $Source: /home/jrmuizel/cvs-mirror/mozilla/webtools/tinderbox2/src/lib/TinderDB/Build.pm,v $
# $Name: $ # $Name: $
@ -429,13 +429,17 @@ sub trim_db_history {
my ($self, $tree, ) = (@_); my ($self, $tree, ) = (@_);
my ($last_time) = $main::TIME - $TinderDB::TRIM_SECONDS; my ($last_time) = $main::TIME - $TinderDB::TRIM_SECONDS;
my (@run_times) = (); my (@all_build_names);
my (@dead_times) = ();
my (@all_build_names) = all_build_names($tree); # compute averages.
@all_build_names = all_build_names($tree);
foreach $buildname (@all_build_names) { foreach $buildname (@all_build_names) {
my ($last_index) = undef; my ($last_index) = undef;
my (@run_times) = ();
my (@dead_times) = ();
my $recs = $DATABASE{$tree}{$buildname}{'recs'}; my $recs = $DATABASE{$tree}{$buildname}{'recs'};
foreach $db_index (0 .. $#{ $recs }) { foreach $db_index (0 .. $#{ $recs }) {
@ -490,6 +494,17 @@ sub trim_db_history {
$DATABASE{$tree}{$buildname}{'recs'} = [ @new_table ]; $DATABASE{$tree}{$buildname}{'recs'} = [ @new_table ];
} }
# columns which have not received data in a long while are purged.
my ($rec) = $DATABASE{$tree}{$buildname}{'recs'}[0];
if (
!(defined($rec)) ||
($rec->{'starttime'} < $last_time)
0) {
delete $DATABASE{$tree}{$buildname};
}
} }
return ; return ;
} }