Skip to content

Commit

Permalink
Unregistering services for which we actually have a key.
Browse files Browse the repository at this point in the history
  • Loading branch information
laeti-tia committed Sep 10, 2019
1 parent 029dbc1 commit 8eff93d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/perfSONAR_PS/LSRegistrationDaemon/Base.pm
Expand Up @@ -338,20 +338,20 @@ sub bulk_refresh {
if ( $current_reg->{CONF}->{force_up_status} || $current_reg->is_up ) {
$current_reg->{LOGGER}->debug( "Service is up" );

$current_reg->{LOGGER}->debug( "Current reg status" . $current_reg->{STATUS});
$current_reg->{LOGGER}->debug( "Current reg status " . $current_reg->{STATUS});

#check if record has changed, if it has then need to re-register
my ($existing_key, $next_refresh) = $current_reg->find_key();
if($current_reg->{KEY} && !$existing_key){
$current_reg->{LOGGER}->debug( "Current reg status" . $current_reg->{STATUS});
$current_reg->{LOGGER}->debug( "Current reg status " . $current_reg->{STATUS});
$current_reg->{LOGGER}->info( "didn't find existing key " . $current_reg->{KEY} );
$current_reg->unregister();
}

#perform needed LS operation
if ( $current_reg->{STATUS} ne "REGISTERED" ) {
$current_reg->{LOGGER}->info( "Record is up, registering (description=" . $current_reg->description() . ")" );
$current_reg->{LOGGER}->debug( "Current reg status" . $current_reg->{STATUS});
$current_reg->{LOGGER}->debug( "Current reg status " . $current_reg->{STATUS});
$current_reg->register();
}
elsif ( time >= $self->{NEXT_REFRESH} ) {
Expand All @@ -362,7 +362,7 @@ sub bulk_refresh {
$current_reg->{LOGGER}->debug( "No need to refresh" );
}
}
elsif ( $self->{STATUS} eq "REGISTERED" ) {
elsif ( $self->{STATUS} eq "REGISTERED" && $current_reg->{KEY}) {
$current_reg->{LOGGER}->info( "Record is down, unregistering (key=" . $current_reg->{KEY} . ", description=" . $current_reg->description() . ")" );
$current_reg->unregister();
}
Expand Down

0 comments on commit 8eff93d

Please sign in to comment.