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
No related branches found
No related tags found
No related merge requests found
......@@ -283,10 +283,14 @@ ServerAccountManager::sendRequest(const std::shared_ptr<dht::http::Request>& req
void
ServerAccountManager::clearRequest(const std::weak_ptr<dht::http::Request>& request)
{
if (auto req = request.lock()) {
std::lock_guard lock(requestLock_);
requests_.erase(req);
}
Manager::instance().ioContext()->post([w=weak_from_this(), request] {
if (auto this_ = std::static_pointer_cast<ServerAccountManager>(w.lock())) {
if (auto req = request.lock()) {
std::lock_guard lock(this_->requestLock_);
this_->requests_.erase(req);
}
}
});
}
void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment