async markRead in channels to make it faster

This commit is contained in:
csoler 2021-01-24 22:33:23 +01:00
parent 7fe5d390e4
commit eef16461d6

@ -796,7 +796,7 @@ void RsGxsChannelPostsModel::setAllMsgReadStatus(bool read_status)
// 2 - then call the async methods
for(uint32_t i=0;i<pairs.size();++i)
RsThread::async([p=pairs[i], read_status]()
RsThread::async([p=pairs[i], read_status]() // use async because each markRead() waits for the token to complete in order to properly acknowledge it.
{
if(!rsGxsChannels->markRead(p,read_status))
RsErr() << "setAllMsgReadStatus: failed to change status of msg " << p.first << " in group " << p.second << " to status " << read_status << std::endl;