Skip to content

Commit

Permalink
[backend] send repository events to repservers only on finished repos…
Browse files Browse the repository at this point in the history
…itories

This is reducing load on dispatcher when sending repository events
  • Loading branch information
adrianschroeter committed Jul 6, 2015
1 parent 7b0a25b commit bc5860c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/backend/bs_sched
Original file line number Diff line number Diff line change
Expand Up @@ -9140,6 +9140,7 @@ NEXTPRP:
if ($locked) {
print " publishing is locked\n";
} elsif (! -e "$reporoot/$prp/$myarch/:repodone") {
sendrepochangeevent($prp, "repositoryfinished");
if (($repodonestate !~ /^disabled/) || -d "$reporoot/$prp/$myarch/:repo") {
mkdir_p("$reporoot/$prp/$myarch");
$publisherror = prpfinished($ctx, \@packs, \%pubenabled);
Expand Down
6 changes: 5 additions & 1 deletion src/backend/bs_srcserver
Original file line number Diff line number Diff line change
Expand Up @@ -8011,8 +8011,12 @@ sub newevent {
for ('type', 'project', 'package', 'repository', 'arch', 'job') {
$ev->{$_} = $cgi->{$_} if defined $cgi->{$_};
}
if ($ev->{type} eq 'repositoryfinished') {
# wake up scheduler on local partition, they may have products using this
$ev->{type} = 'repository';
notify_repservers($ev->{type}, $ev->{project}, undef, $ev->{repository}, $ev->{arch});
};
addevent($ev);
notify_repservers($ev->{type}, $ev->{project}, undef, $ev->{repository}, $ev->{arch}) if $ev->{type} eq 'repository';
return $BSStdServer::return_ok;
}

Expand Down

0 comments on commit bc5860c

Please sign in to comment.