Skip to content

Commit

Permalink
[backend] tweak setup_projects() heuristic and be more verbose
Browse files Browse the repository at this point in the history
We used to switch to a full update when the number of changed
projects is bigger than 200. Lets try a higher threshold.

Also use BSUtil::printlog so that we get a time stamp.
  • Loading branch information
mlschroe committed Sep 30, 2020
1 parent f01dd4c commit 64ae5c9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/backend/BSSched/ProjPacks.pm
Original file line number Diff line number Diff line change
Expand Up @@ -833,14 +833,20 @@ sub setup_projects {
my $projpacks = $gctx->{'projpacks'};

my $t1 = Time::HiRes::time();
undef $projids_todo if $projids_todo && @$projids_todo > 200; # removing old stuff takes too long
my $projids_todo_cnt = scalar(@{$projids_todo || []});
undef $projids_todo if $projids_todo_cnt > 1000; # removing old stuff takes too long

my @projids_todo;
if ($projids_todo) {
print "updating project dependencies for ".scalar(@$projids_todo)." projects...\n";
BSUtil::printlog("updating project dependencies for $projids_todo_cnt projects...");
@projids_todo = BSUtil::unify(@$projids_todo);
} else {
print "calculating project dependencies...\n";
if ($projids_todo_cnt) {
my $projids_all_cnt = scalar(keys %$projpacks);
BSUtil::printlog("calculating project dependencies ($projids_todo_cnt/$projids_all_cnt)...");
} else {
BSUtil::printlog("calculating project dependencies...");
}
@projids_todo = sort keys %$projpacks;
}

Expand Down

0 comments on commit 64ae5c9

Please sign in to comment.