mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-08 23:39:31 -04:00
fixed bug in updating cache from DB
This commit is contained in:
parent
95fc1a56c8
commit
3d1e43cf25
1 changed files with 7 additions and 0 deletions
|
@ -1519,7 +1519,10 @@ int RsDataService::updateGroupMetaData(const GrpLocMetaData& meta)
|
||||||
|
|
||||||
c->moveToFirst();
|
c->moveToFirst();
|
||||||
|
|
||||||
|
// temporarily disable the cache so that we get the value from the DB itself.
|
||||||
|
mUseCache=false;
|
||||||
auto meta = locked_getGrpMeta(*c, 0);
|
auto meta = locked_getGrpMeta(*c, 0);
|
||||||
|
mUseCache=true;
|
||||||
|
|
||||||
if(meta)
|
if(meta)
|
||||||
mGrpMetaDataCache.updateMeta(grpId,meta);
|
mGrpMetaDataCache.updateMeta(grpId,meta);
|
||||||
|
@ -1548,7 +1551,11 @@ int RsDataService::updateMessageMetaData(const MsgLocMetaData& metaData)
|
||||||
RetroCursor* c = mDb->sqlQuery(MSG_TABLE_NAME, mMsgMetaColumns, KEY_GRP_ID+ "='" + grpId.toStdString() + "' AND " + KEY_MSG_ID + "='" + msgId.toStdString() + "'", "");
|
RetroCursor* c = mDb->sqlQuery(MSG_TABLE_NAME, mMsgMetaColumns, KEY_GRP_ID+ "='" + grpId.toStdString() + "' AND " + KEY_MSG_ID + "='" + msgId.toStdString() + "'", "");
|
||||||
|
|
||||||
c->moveToFirst();
|
c->moveToFirst();
|
||||||
|
|
||||||
|
// temporarily disable the cache so that we get the value from the DB itself.
|
||||||
|
mUseCache=false;
|
||||||
auto meta = locked_getMsgMeta(*c, 0);
|
auto meta = locked_getMsgMeta(*c, 0);
|
||||||
|
mUseCache=true;
|
||||||
|
|
||||||
if(meta)
|
if(meta)
|
||||||
mMsgMetaDataCache[grpId].updateMeta(msgId,meta);
|
mMsgMetaDataCache[grpId].updateMeta(msgId,meta);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue