|
@@ -62,7 +62,7 @@ const DWORD HEALTHMANAGER_WAIT_MAINPAGE_OPEN_TIMER_ID = 2;
|
|
|
const DWORD HEALTHMANAGER_SELFCHECK_TIMER_ID = 3;
|
|
|
const DWORD HEALTHMANAGER_TIMER_INTERVAL = 60000;
|
|
|
const DWORD HEALTHMANAGER_WAIT_MAINPAGE_OPEN_TIMER_INTERVAL = 60000;
|
|
|
-const DWORD HEALTHMANAGER_TIMER_INTERVAL_MINUTE = (HEALTHMANAGER_TIMER_INTERVAL/60000)*3;
|
|
|
+const DWORD HEALTHMANAGER_REBOOT_OS_IN_MINUTES_AFTER_TIME = 10;
|
|
|
const DWORD HEALTHMANAGER_SELFCHECK_TIMER_INTERVAL = 60000;
|
|
|
const int MAX_STOP_AYSNC_TIMEOUT = 20000;
|
|
|
const int MAX_TERM_AYSNC_TIMEOUT = 30000;
|
|
@@ -350,7 +350,7 @@ ErrorCodeEnum CHealthManagerEntity::RestartModule(const char* pEntityName)
|
|
|
if (it == m_modRunInfo.end())
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("add %s to modfuninfo(%d).",pEntityName,m_modRunInfo.size());
|
|
|
- m_modRunInfo[pEntityName].dwStart = GetTickCountRVC();
|
|
|
+ m_modRunInfo[pEntityName].dwStart = SP::Module::Comm::RVCGetTickCount();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -426,31 +426,25 @@ void CHealthManagerEntity::OnCheckTimeTimeout()
|
|
|
FrameworkShutdown();
|
|
|
}
|
|
|
}
|
|
|
- SYSTEMTIME localTime;
|
|
|
- GetLocalTimeRVC(localTime);
|
|
|
+
|
|
|
+ m_OSRunTicks = SP::Module::Comm::RVCGetTickCount();
|
|
|
+ //oilyang@20240603 reboot os after reaching setting time in 10 minutes
|
|
|
+ if (m_OSRunTicks > (m_restartHour * 60 * 60 * 1000 + m_restartMinute * 60 * 1000)
|
|
|
+ && m_OSRunTicks < (m_restartHour * 60 * 60 * 1000 + (m_restartMinute + HEALTHMANAGER_REBOOT_OS_IN_MINUTES_AFTER_TIME) * 60 * 1000))
|
|
|
+ {
|
|
|
+ m_eRebootTrigger = RebootTrigger_Period;
|
|
|
+ m_eRebootWay = RebootWay_Power;
|
|
|
+ BOOL bRet = SystemRestart(true);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnCheckTimeTimeout")("restart machine bRet=%d, LastError=%d", bRet, GetLastError());
|
|
|
+ }
|
|
|
+
|
|
|
ErrorCodeEnum eErr = Error_Unexpect;
|
|
|
|
|
|
- //99 is initial value of m_preDay
|
|
|
- m_preDay = localTime.wDayOfWeek;
|
|
|
CSmartPointer<IConfigInfo> spConfigRun;
|
|
|
eErr = GetFunction()->OpenConfig(Config_Run, spConfigRun);
|
|
|
if (eErr != Error_Succeed)
|
|
|
DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("timer open cfg file failed!");
|
|
|
|
|
|
-
|
|
|
- if (m_wDayOfWeek != localTime.wDayOfWeek)
|
|
|
- {
|
|
|
- if (localTime.wHour == m_restartHour && localTime.wMinute >= m_restartMinute
|
|
|
- && localTime.wMinute <= (m_restartMinute + HEALTHMANAGER_TIMER_INTERVAL_MINUTE))
|
|
|
- {
|
|
|
- m_wDayOfWeek = localTime.wDayOfWeek;
|
|
|
- m_eRebootTrigger = RebootTrigger_Period;
|
|
|
- m_eRebootWay = RebootWay_Power;
|
|
|
- BOOL bRet = SystemRestart(true);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnCheckTimeTimeout")("restart machine[%d][%d] bRet=%d, LastError=%d", localTime.wHour, localTime.wMinute, bRet, GetLastError());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
if (!m_bSayIdle)
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_fsm.GetFSMState():%d", m_fsm.GetFSMState());
|
|
|
int iCheckGuardian = 0;
|
|
@@ -936,11 +930,7 @@ bool CHealthManagerEntity::DoRestart()
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("[NonExclusive],NonGuardian=%s", csimpleStrMachineTypeCfg.GetData());
|
|
|
SYSTEMTIME localTime;
|
|
|
GetLocalTimeRVC(localTime);
|
|
|
- if (m_bInit)
|
|
|
- {
|
|
|
- m_bInit = false;
|
|
|
- m_wDayOfWeek = localTime.wDayOfWeek;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
ITimerListener *pListener = new TimerOutHelper<CHealthManagerEntity>(this, &CHealthManagerEntity::OnCheckTimeTimeout);
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set check timer %d(ms)", HEALTHMANAGER_TIMER_INTERVAL);
|
|
@@ -1328,7 +1318,7 @@ void CHealthManagerEntity::OnLog(const CAutoArray<CUUID>& SubIDs, const CUUID nL
|
|
|
m_fsm.SetAccessAuth(AccessAuth_Suc);
|
|
|
m_bNeedAuthRetry = false;
|
|
|
m_bNeedGuardianRestart = true;
|
|
|
- m_dwTimeOfAuthSuc = GetTickCount64() / 1000;
|
|
|
+ m_dwTimeOfAuthSuc = SP::Module::Comm::RVCGetTickCount() / 1000;
|
|
|
GetFunction()->SetTimer(HEALTHMANAGER_WAIT_MAINPAGE_OPEN_TIMER_ID, this, m_maxWaitMainpageTime);
|
|
|
|
|
|
CSimpleStringA msg(true);
|
|
@@ -1443,7 +1433,7 @@ void CHealthManagerEntity::OnSysVarEvent(const char *pszKey, const char *pszValu
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402501Z10401")(m_sysStaticInfo.InstallVersion.ToString().GetData());
|
|
|
m_bHaveThrowMainPage = true;
|
|
|
|
|
|
- ULONGLONG dwElapse = GetTickCount64();//使用机器启动时间秒数
|
|
|
+ ULONGLONG dwElapse = SP::Module::Comm::RVCGetTickCount();//使用机器启动时间秒数
|
|
|
DWORD elapseTimeTemp = dwElapse / 1000;
|
|
|
DWORD dwToMainPageCostTime = elapseTimeTemp - m_dwTimeOfAuthSuc;//从准入通过到首次收到进入首页事件
|
|
|
CSimpleStringA xMsg = CSimpleStringA::Format("{\"Decripstion\":\"the first enter main page from HealthManger started.\",\"version\":\"%s\",\"elapseTime\":\"%d\",\"enterMainPageTime\":\"%d\"}"
|
|
@@ -1466,7 +1456,7 @@ void CHealthManagerEntity::OnSysVarEvent(const char *pszKey, const char *pszValu
|
|
|
m_bBrowserIdleFirst = false;
|
|
|
m_bEnterMainPageEver = true;
|
|
|
LogEvent(Severity_Middle, LOG_EVT_HEALTH_FIRST_ENTER_MAINPADE, "enter main page");
|
|
|
- ULONGLONG dwElapse = GetTickCount64();//使用机器启动时间秒数
|
|
|
+ ULONGLONG dwElapse = SP::Module::Comm::RVCGetTickCount();//使用机器启动时间秒数
|
|
|
DWORD elapseTimeTemp = dwElapse / 1000;
|
|
|
CSimpleStringA xMsg = CSimpleStringA::Format("{\"Decripstion\":\"the first enter main page from browser started.\",\"version\":\"%s\",\"elapseTime\":\"%d\"}"
|
|
|
, m_sysStaticInfo.InstallVersion.ToString().GetData(), elapseTimeTemp);
|