Skip to content
Snippets Groups Projects
Commit 73a1e806 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

ServerAccountManager: re-schedule request deletion

GitLab: #1101
Change-Id: Ifaee9fe0a2b79716e00ccc1a12c8c78c348e80bf
parent 5ac7a9eb
Branches
No related tags found
No related merge requests found
...@@ -283,10 +283,14 @@ ServerAccountManager::sendRequest(const std::shared_ptr<dht::http::Request>& req ...@@ -283,10 +283,14 @@ ServerAccountManager::sendRequest(const std::shared_ptr<dht::http::Request>& req
void void
ServerAccountManager::clearRequest(const std::weak_ptr<dht::http::Request>& request) ServerAccountManager::clearRequest(const std::weak_ptr<dht::http::Request>& request)
{ {
if (auto req = request.lock()) { Manager::instance().ioContext()->post([w=weak_from_this(), request] {
std::lock_guard lock(requestLock_); if (auto this_ = std::static_pointer_cast<ServerAccountManager>(w.lock())) {
requests_.erase(req); if (auto req = request.lock()) {
} std::lock_guard lock(this_->requestLock_);
this_->requests_.erase(req);
}
}
});
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment