Skip to content

Commit 8079b91

Browse files
committed
fixed:found file some incorrent for memory database
modify:first flush database for memory
1 parent 2c8b655 commit 8079b91

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

XEngine_Source/StorageModule_Database/Database_Memory/Database_Memory.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ bool CDatabase_Memory::Database_Memory_FileQuery(XSTORAGECORE_DBFILE*** pppSt_Li
222222
bFound = true;
223223
break;
224224
}
225+
}
226+
else
227+
{
228+
bFound = true;
229+
break;
225230
}
226231
}
227232
}
@@ -237,7 +242,11 @@ bool CDatabase_Memory::Database_Memory_FileQuery(XSTORAGECORE_DBFILE*** pppSt_Li
237242
break;
238243
}
239244
}
240-
break;
245+
else
246+
{
247+
bFound = true;
248+
break;
249+
}
241250
}
242251
}
243252
}
@@ -268,7 +277,7 @@ bool CDatabase_Memory::Database_Memory_Flush()
268277
Database_IsErrorOccur = false;
269278

270279
st_Locker->lock();
271-
stl_ListFile.clear();
280+
stl_ListFile.clear(); //fixme:improved find
272281
for (auto stl_ListIterator = stl_ListBucket.begin(); stl_ListIterator != stl_ListBucket.end(); stl_ListIterator++)
273282
{
274283
int nListCount = 0;
@@ -316,7 +325,9 @@ XHTHREAD CDatabase_Memory::Database_Memory_Thread(XPVOID lParam)
316325
CDatabase_Memory *pClass_This = (CDatabase_Memory *)lParam;
317326
time_t nTimeStart = time(NULL);
318327
time_t nTimeEnd = 0;
319-
int nTime = 60;
328+
int nTime = 60 * 60;
329+
330+
pClass_This->Database_Memory_Flush();//优先刷新
320331

321332
while (pClass_This->m_bIsRun)
322333
{

XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskP2p.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ XHTHREAD XEngine_Task_P2PThread()
3030
//查询文件是否存在数据库,不存在不关心
3131
int nListCount = 0;
3232
XSTORAGECORE_DBFILE** pppSt_ListFile;
33-
Database_File_FileQuery(&pppSt_ListFile, &nListCount, tszTimeStart, tszTimeEnd, tszBuckKey, NULL, tszFileName, tszFileHash);
33+
Database_Memory_FileQuery(&pppSt_ListFile, &nListCount, tszBuckKey, tszFileName, tszFileHash);
3434
if (nListCount > 0)
3535
{
3636
_xstprintf(pppSt_ListFile[0]->tszTableName, _X("%s:%d"), st_ServiceCfg.tszIPAddr, st_ServiceCfg.nStorageDLPort);

0 commit comments

Comments
 (0)