Переглянути джерело

Z991239-6399 #comment feat: 1. 文件列表上送RTA补充 2. 触发时机调整

陈纪林80310970 2 місяців тому
батько
коміт
15338269d1

+ 16 - 11
Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp

@@ -330,6 +330,20 @@ void ResourceWatcherFSM::TriggerProccessUpload()
     }
 }
 
+void ResourceWatcherFSM::TriggerFileListUpload()
+{
+    CSmartPointer<IConfigInfo> spCtSettingConfig;
+    //集中配置读取需要上送的路径
+    CSimpleStringA fileListPath("");
+    spCtSettingConfig->ReadConfigValue(m_pEntity->GetEntityName(), "DirPathToUploadFileList", fileListPath);
+    if (!fileListPath.IsNullOrEmpty())
+    {
+        m_fileListPath = fileListPath.Split('|');
+        UploadDirPathFileListTask* uploadFileListTask = new UploadDirPathFileListTask(this);
+        GetEntityBase()->GetFunction()->PostThreadPoolTask(uploadFileListTask);
+    }
+}
+
 ErrorCodeEnum ResourceWatcherFSM::OnInit()
 {
     neverMainPage = true;		//是否未进入过首页
@@ -359,15 +373,6 @@ ErrorCodeEnum ResourceWatcherFSM::OnInit()
         m_skipDesktopDetect = TRUE;
     }
     spRunConfig->ReadConfigValueInt("WarnRecord", "disk", m_diskLastWarnHour);
-    //集中配置读取需要上送的路径
-    CSimpleStringA fileListPath("");
-    spCtSettingConfig->ReadConfigValue(m_pEntity->GetEntityName(), "DirPathToUploadFileList", fileListPath);
-    if (!fileListPath.IsNullOrEmpty())
-    {
-        m_fileListPath = fileListPath.Split('|');
-        UploadDirPathFileListTask* uploadFileListTask = new UploadDirPathFileListTask(this);
-        GetEntityBase()->GetFunction()->PostThreadPoolTask(uploadFileListTask);
-    }
 
     return Error_Succeed;
 }
@@ -4967,12 +4972,12 @@ void ResourceWatcherFSM::UploadDirPathFileList(CSimpleStringA dirFilePath)
     if (attrs == INVALID_FILE_ATTRIBUTES)
     {
         const DWORD lastError = GetLastError();
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Acess to path error:[%s], GLE = %u.", realPath.GetData(), lastError);
+        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA5A15")("Acess to path error:[%s], GLE = %u.", realPath.GetData(), lastError);
         return;
     }
     else  if (!(attrs & FILE_ATTRIBUTE_DIRECTORY))
     { //非文件夹类型
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Path [%s]  is not Directory!", realPath.GetData());
+        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA5A15")("Path [%s]  is not Directory!", realPath.GetData());
         return;
     }
 

+ 4 - 1
Module/mod_ResourceWatcher/ResourceWatcherFSM.h

@@ -237,6 +237,7 @@ public:
 	//进入首页时触发的功能在此
 	void TriggerAtStatusChanged(bool bMStatus);
 	void TriggerProccessUpload();
+	void TriggerFileListUpload();
 
 	void AfterInit();
 
@@ -524,6 +525,9 @@ struct DiskAndFilesTask : public ITaskSp
 			m_pFSM->GetEntityBase()->GetFunction()->SetTimer(TIMER_DISK_CHECK, pListener, checkTime);
 			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Set DISK CHECK Timer!");
 		}
+
+		//清理结束后触发
+		m_pFSM->TriggerFileListUpload();
 	}
 };
 
@@ -544,7 +548,6 @@ struct UploadSysProcInfoTask : public ITaskSp
 	UploadSysProcInfoTask(ResourceWatcherFSM* pFSM) : m_pFSM(pFSM) {}
 	void Process()
 	{
-		CSimpleStringA t_terminalState;
 		DWORD elapsed = 0;
 		DWORD dwStart = SP::Module::Comm::RVCGetTickCount();
 		DWORD dwEnd = SP::Module::Comm::RVCGetTickCount();

+ 8 - 0
Module/mod_ResourceWatcher/mod_ResourceWatcher.h

@@ -98,6 +98,10 @@ public:
 		{
 			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Terminal has been lastStage(%s) before ResourceWatcher start.", terminalStage);
 			m_fsm.TriggerProccessUpload();
+			if (!(0 == CSimpleStringA("A").Compare(terminalStage, true))) //非首页,已达终态
+			{
+				m_fsm.TriggerFileListUpload();
+			}
 		}
 		else
 		{
@@ -247,6 +251,10 @@ public:
 			{
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Status changed, teminalStage = %s.", pszValue);
 				m_fsm.TriggerProccessUpload();
+				if (!(0 == CSimpleStringA("A").Compare(pszValue, true))) //非通过准入的情况下,直接开始文件列表获取
+				{
+					m_fsm.TriggerFileListUpload();
+				}
 			}
 		}
 	}