|
@@ -172,22 +172,33 @@ void CDeviceControlFSM::DoBrowserCacheClearJob()
|
|
|
err = spConfig->ReadConfigValue("Browser", "CacheClear", str);
|
|
|
if (str.Compare("true", true) == 0) {
|
|
|
|
|
|
+ BOOL bSucc(FALSE);
|
|
|
CSimpleStringA strCachePath;
|
|
|
GetEntityBase()->GetFunction()->GetPath("Temp", strCachePath);
|
|
|
if (!strCachePath.IsNullOrEmpty()) {
|
|
|
- strCachePath += SPLIT_SLASH_STR;
|
|
|
- strCachePath += "cefCache";
|
|
|
|
|
|
- Dbg("browser cache path: %s", strCachePath.GetData());
|
|
|
+ bSucc = TRUE;
|
|
|
+
|
|
|
+ const char* cacheDirs[] = {"cefCache", "cefCache_Ad", "cefCache_breakdown", "cefCache_ErrNotify", "cefCache_main"
|
|
|
+ , "UOSBrowser_Ad", "UOSBrowser_main" };
|
|
|
+
|
|
|
+ for(int i=0; i<array_size(cacheDirs); ++i)
|
|
|
+ {
|
|
|
+ CSimpleStringA strcefCachePath(strCachePath);
|
|
|
+ strcefCachePath += SPLIT_SLASH_STR;
|
|
|
+ strcefCachePath += cacheDirs[i];
|
|
|
+
|
|
|
+ if (ExistsDirA(strcefCachePath)) {
|
|
|
+ RemoveDirRecursiveA(strcefCachePath);
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_DEVICECONTROL_BROWSER_CACHE_CLEAER,
|
|
|
+ CSimpleStringA::Format("clear chromium browser cache: %s", strcefCachePath.GetData()));
|
|
|
+ }
|
|
|
|
|
|
- if (ExistsDirA(strCachePath)) {
|
|
|
- RemoveDirRecursiveA(strCachePath);
|
|
|
- LogWarn(Severity_Middle, Error_Debug, LOG_DEVICECONTROL_BROWSER_CACHE_CLEAER, "clear chromium browser cache.");
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- if (!ExistsDirA(strCachePath)) {
|
|
|
- spConfig->WriteConfigValue("Browser", "CacheClear", NULL);
|
|
|
- }
|
|
|
+ if (bSucc) {
|
|
|
+ spConfig->WriteConfigValue("Browser", "CacheClear", NULL);
|
|
|
}
|
|
|
}
|
|
|
}
|