Skip to content

Commit

Permalink
[backend] avoid sending events to disabled archs
Browse files Browse the repository at this point in the history
we collect endless event files otherwise
  • Loading branch information
adrianschroeter committed Jun 11, 2016
1 parent f817a34 commit 7ecb8e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/backend/BSConfiguration.pm
Expand Up @@ -41,11 +41,12 @@ $bsconfigvalues{'forceprojectkeys'} = 1 if defined $BSConfig::forceprojectkeys;
my $configurationid = '';
my $configuration_file = "$BSConfig::bsdir/configuration.xml";
my $confiuration_checked_once;
our $xml;

sub update_from_configuration {
my @s = stat($configuration_file);
$configurationid = @s ? "$s[9]/$s[7]/$s[1]" : '';
my $xml = readxml($configuration_file, $BSXML::configuration, 1) || {};
$xml = readxml($configuration_file, $BSXML::configuration, 1) || {};
$BSConfig::obsname = $xml->{'name'} unless $bsconfigvalues{'obsname'};
$BSConfig::proxy = $xml->{'http_proxy'} unless $bsconfigvalues{'proxy'};
$BSConfig::noproxy = $xml->{'no_proxy'} unless $bsconfigvalues{'noproxy'};
Expand Down
2 changes: 1 addition & 1 deletion src/backend/bs_admin
Expand Up @@ -36,7 +36,7 @@ use XML::Structured ':bytes';

use Build;

use BSConfig;
use BSConfiguration;
use BSFileDB;
use BSWatcher;
use BSUtil;
Expand Down
10 changes: 8 additions & 2 deletions src/backend/bs_repserver
Expand Up @@ -2128,8 +2128,14 @@ sub forwardevent {
writexml("$eventdir/$arch/.$evname.$$", "$eventdir/$arch/$evname", $ev, $BSXML::event);
BSUtil::ping("$eventdir/$arch/.ping");
} else {
# XXX: there should be a better way than to just write in all
# directories... maybe a architecture list in BSConfig?
my @archs;
if ($BSConfiguration::xml->{'schedulers'} && $BSConfiguration::xml->{'schedulers'}->{'arch'}) {
# notify only active schedulers
@archs = @{$BSConfiguration::xml->{'schedulers'}->{'arch'}};
} else {
# unconfigured, fallback to all existing directories
@archs = ls($eventdir);
}
for my $a (ls($eventdir)) {
next if $a =~ /^\./;
next unless -d "$eventdir/$a";
Expand Down

0 comments on commit 7ecb8e4

Please sign in to comment.