Skip to content

Commit

Permalink
prune pending requests explicitly instead of relying on destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
authaldo committed Aug 27, 2023
1 parent 5508e0a commit 78092b7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/service_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,17 @@ void ServiceWrapper::checkForTimeouts() {
}

void ServiceWrapper::setNodeOfInterest(const std::string &name) {
// TODO: cancel any requests related to the previously selected node?
// Maybe this is already done in the destructor of the client?
if (listParametersClient) {
listParametersClient->prune_pending_requests();
}

if (getParametersClient) {
getParametersClient->prune_pending_requests();
}

if (setParametersClient) {
setParametersClient->prune_pending_requests();
}

nodeName = name;

Expand Down

0 comments on commit 78092b7

Please sign in to comment.