Skip to content

Commit

Permalink
For discovery clients using publish re-evaluate options, send only pu…
Browse files Browse the repository at this point in the history
…blish

periodically (there is no need to send heart-beat in addition to publish)

Change-Id: Ic4fccfe783bf7595ca5bd4c5b35385def58b819f
Partial-Bug:1488936
  • Loading branch information
nipak committed Aug 31, 2015
1 parent 86ca4c3 commit 91127ba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/discovery/client/discovery_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,17 @@ bool DSPublishResponse::HeartBeatTimerExpired() {
DiscoveryServiceClient::ReEvalPublishCbHandlerMap::iterator it =
ds_client_->reeval_publish_map_.find(serviceName_);
if (it != ds_client_->reeval_publish_map_.end()) {
// publish is sent periodically
ds_client_->reevaluate_publish_cb_queue_.Enqueue(
boost::bind(&DiscoveryServiceClient::ReEvaluatePublish, ds_client_,
serviceName_, it->second));
} else {
stringstream hb;
hb.clear();
hb << "<cookie>" << cookie_ << "</cookie>" ;
ds_client_->SendHeartBeat(serviceName_, hb.str());
}

stringstream hb;
hb.clear();
hb << "<cookie>" << cookie_ << "</cookie>" ;
ds_client_->SendHeartBeat(serviceName_, hb.str());
//
// Start the timer again, by returning true
//
Expand Down

0 comments on commit 91127ba

Please sign in to comment.