|
@@ -480,7 +480,8 @@ ErrorCodeEnum ResourceWatcherFSM::OnInit()
|
|
|
InitBlackList();
|
|
|
readVideoStoreData();
|
|
|
m_bReadyFlag = IsNeedToFirstClear();
|
|
|
- Dbg("Retrieve uploadedVideo path[%s], backwardDays(%d) done(%d)", (LPCTSTR)m_uploadedVideoDirPath, m_nDayOfBackward, !m_bReadyFlag);
|
|
|
+ Dbg("Retrieve uploadedVideo path[%s], backwardDays(%d) done(%d)"
|
|
|
+ , (LPCTSTR)m_uploadedVideoDirPath, m_nDayOfBackward, !m_bReadyFlag);
|
|
|
|
|
|
#if defined(_MSC_VER)
|
|
|
if (!sysInfo.strMachineType.Compare("RVC.Desk2S", true)) {
|
|
@@ -1388,7 +1389,7 @@ void ResourceWatcherFSM::CleanMoreVideoFiles()
|
|
|
//对比上次,剩余的可用磁盘空间更小了。
|
|
|
if (mUiCalibration >= uiFreeDiskBytes) {
|
|
|
Dbg("Previous Set CurRank from %d to %d.", CurRank, BfRank);
|
|
|
- CurRank = BfRank;
|
|
|
+ CurRank = BfRank == 4 ? 1: BfRank;
|
|
|
}
|
|
|
mUiCalibration = uiFreeDiskBytes;
|
|
|
}
|
|
@@ -1413,7 +1414,9 @@ void ResourceWatcherFSM::CleanMoreVideoFiles()
|
|
|
Dbg("Required free disk size: %s, current rank: %d", szResult, CurRank);
|
|
|
unsigned long long uiMoreSpaceRealRequired(0);
|
|
|
unsigned long long uiAdjustment(0);
|
|
|
- if (diskInfo.IsNeedToDoClearJobEx((LPCTSTR)m_uploadedVideoDirPath, uiSpaceRequired, uiAdjustment, &uiMoreSpaceRealRequired) && uiMoreSpaceRealRequired > 0) {
|
|
|
+ if (diskInfo.IsNeedToDoClearJobEx((LPCTSTR)m_uploadedVideoDirPath, uiSpaceRequired, uiAdjustment, &uiMoreSpaceRealRequired)
|
|
|
+ && uiMoreSpaceRealRequired > 0) {
|
|
|
+
|
|
|
unsigned long long uiNewFreeBytes(0);
|
|
|
UINT uDeletedCnt = 0, uFailedDeleteCnt = 0;
|
|
|
BOOL bTrackBackStop = FALSE;
|
|
@@ -1449,17 +1452,15 @@ void ResourceWatcherFSM::CleanMoreVideoFiles()
|
|
|
CurRank, uDeletedCnt, uFailedDeleteCnt, szOutput, szOutput2);
|
|
|
if (uiNewFreeBytes >= uiMoreSpaceRealRequired) {
|
|
|
break;
|
|
|
+ } else {
|
|
|
+ --CurRank;
|
|
|
}
|
|
|
- --CurRank;
|
|
|
|
|
|
#ifdef WITH_DEBUG
|
|
|
UINT uCount = 0;
|
|
|
- for (const_map_cu_iter citer = VideoDailyRecord.cbegin(); citer != VideoDailyRecord.cend(); citer++) {
|
|
|
- uCount += citer->second;
|
|
|
- }
|
|
|
+ for (const_map_cu_iter citer = VideoDailyRecord.cbegin(); citer != VideoDailyRecord.cend(); citer++) { uCount += citer->second; }
|
|
|
Dbg("FileCount(%d)(%d)", uCount, m_VideoFiles.size());
|
|
|
#endif
|
|
|
-
|
|
|
} else {
|
|
|
LeaveCriticalSection(&g_csVideoMoreClear);
|
|
|
return;
|
|
@@ -1483,10 +1484,8 @@ void ResourceWatcherFSM::CleanMoreVideoFiles()
|
|
|
} else {
|
|
|
strcpy(szResult3, "Disk space is enough for recording.");
|
|
|
}
|
|
|
- if (CurRank == 0) {
|
|
|
- CurRank = 4;
|
|
|
- }
|
|
|
|
|
|
+ if (CurRank == 0) { CurRank = 4; }
|
|
|
if (BfRank != CurRank) {
|
|
|
erroCode = spConfigRun->WriteConfigValueInt("Video", "RequiredRank", CurRank);
|
|
|
}
|