mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-23 14:41:04 -04:00
added missing acknowledge token in ID service
This commit is contained in:
parent
eef16461d6
commit
16c4e2cef4
1 changed files with 20 additions and 0 deletions
|
@ -680,6 +680,26 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||||
{
|
{
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
RsGenExchange::subscribeToGroup(token, gid, true);
|
RsGenExchange::subscribeToGroup(token, gid, true);
|
||||||
|
|
||||||
|
// we need to acknowledge the token in a async process
|
||||||
|
|
||||||
|
RsThread::async( [this,token]()
|
||||||
|
{
|
||||||
|
std::chrono::milliseconds maxWait = std::chrono::milliseconds(10000);
|
||||||
|
std::chrono::milliseconds checkEvery = std::chrono::milliseconds(100);
|
||||||
|
|
||||||
|
auto timeout = std::chrono::steady_clock::now() + maxWait; // wait for 10 secs at most
|
||||||
|
auto st = requestStatus(token);
|
||||||
|
|
||||||
|
while( !(st == RsTokenService::FAILED || st >= RsTokenService::COMPLETE) && std::chrono::steady_clock::now() < timeout )
|
||||||
|
{
|
||||||
|
std::this_thread::sleep_for(checkEvery);
|
||||||
|
st = requestStatus(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
RsGxsGroupId grpId;
|
||||||
|
acknowledgeGrp(token,grpId);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue