Skip to content

Commit

Permalink
[backend] update remote project data with data from remotemap to redu…
Browse files Browse the repository at this point in the history
…ce RPCs
  • Loading branch information
mlschroe authored and adrianschroeter committed Feb 21, 2013
1 parent d38cc15 commit 8797bd0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/backend/bs_sched
Expand Up @@ -2248,6 +2248,30 @@ sub update_projpacks {
delete $proj->{'package'};
}
}
remotemap2remoteprojs($projpacksin->{'remotemap'});
}

# update remoteprojs with the remotemap data
sub remotemap2remoteprojs {
my ($remotemap) = @_;

for my $proj (@{$remotemap || []}) {
my $projid = delete $proj->{'project'};
my $oproj = $remoteprojs{$projid};
undef $oproj if $oproj && ($oproj->{'remoteurl'} ne $proj->{'remoteurl'} || $oproj->{'remoteproject'} ne $proj->{'remoteproject'});
my $c = $proj->{'config'};
$c = $oproj->{'config'} if !defined($c) && $oproj;
my $error = $proj->{'error'};
delete $proj->{'error'};
$proj = $oproj if $proj->{'proto'} && $oproj && !$oproj->{'proto'};
delete $proj->{'config'};
$proj->{'config'} = $c if defined $c;
if ($error) {
$proj->{'error'} = $error;
addretryevent({'type' => 'project', 'project' => $projid}) if $error =~ /interconnect error:/;
}
$remoteprojs{$projid} = $proj;
}
}

# -> BSUtil
Expand Down

0 comments on commit 8797bd0

Please sign in to comment.