Skip to content

Commit

Permalink
[backend] only do packstatus queries if the packstatus was in the cache
Browse files Browse the repository at this point in the history
We do not want to use them if the bininfo cache has timed out, as we
want to do a refetch every hour.
  • Loading branch information
mlschroe committed Mar 15, 2023
1 parent 5034401 commit 1a7395c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/backend/BSSched/Remote.pm
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ sub cleanup_remotepackstatus {

###########################################################################
###
### remote BuildResult (aka gbininfo) support
### gbininfo cache handling
###

sub read_gbininfo_remote_cache {
Expand Down Expand Up @@ -611,6 +611,11 @@ sub update_gbininfo_remote_cache {
$remotegbininfos->{$prpa}->{'cookie'} = $cookie if defined $cookie;
}

###########################################################################
###
### remote BuildResult (aka gbininfo) support
###

sub read_gbininfo_remote {
my ($ctx, $prpa, $remoteproj, $packstatus) = @_;

Expand Down Expand Up @@ -641,7 +646,7 @@ sub read_gbininfo_remote {

# need to fetch new data, first try the packstatus if we have a bininfo cookie
my ($projid, $repoid, $arch) = split('/', $prpa, 3);
if ($remoteproj->{'partition'} && $remotegbininfos->{$prpa} && $remotegbininfos->{$prpa}->{'cookie'}) {
if ($remoteproj->{'partition'} && $remotegbininfos->{$prpa} && $remotegbininfos->{$prpa}->{'cookie'} && ($packstatus && !$rpackstatus)) {
print " fetching remote packstatus for $prpa\n";
my $param = {
'uri' => "$remoteproj->{'remoteurl'}/build/$remoteproj->{'remoteproject'}/$repoid/$arch",
Expand Down

0 comments on commit 1a7395c

Please sign in to comment.