Skip to content

Commit 58e8a92

Browse files
committed
delete:not retry when start process failed
1 parent ba32f97 commit 58e8a92

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ typedef struct
3333
int nTimeCheck; //检测次数
3434
int nHTTPTimeOut; //HTTP超时时间
3535
int nP2PTimeOut; //P2P客户端超时时间
36-
int nDeamonTime; //进程守护失败执行次数
3736
}st_XTime; //次数*时间=超时
3837
struct
3938
{

XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
100100
pSt_ServerConfig->st_XMax.nIOThread = st_JsonXMax["nIOThread"].asInt();
101101
pSt_ServerConfig->st_XMax.nHTTPThread = st_JsonXMax["nHttpThread"].asInt();
102102

103-
if (st_JsonRoot["XTime"].empty() || (4 != st_JsonRoot["XTime"].size()))
103+
if (st_JsonRoot["XTime"].empty() || (3 != st_JsonRoot["XTime"].size()))
104104
{
105105
Config_IsErrorOccur = true;
106106
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XTIME;
@@ -110,7 +110,6 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
110110
pSt_ServerConfig->st_XTime.nTimeCheck = st_JsonXTime["nTimeCheck"].asInt();
111111
pSt_ServerConfig->st_XTime.nHTTPTimeOut = st_JsonXTime["nHttpTimeOut"].asInt();
112112
pSt_ServerConfig->st_XTime.nP2PTimeOut = st_JsonXTime["nP2PTimeOut"].asInt();
113-
pSt_ServerConfig->st_XTime.nDeamonTime = st_JsonXTime["nDeamonTime"].asInt();
114113

115114
if (st_JsonRoot["XLog"].empty() || (4 != st_JsonRoot["XLog"].size()))
116115
{
@@ -544,6 +543,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_DeamonList(LPCXSTR lpszConfigFi
544543
strcpy(st_APPInfo.tszAPPPath, st_JsonArray[i]["tszAPPPath"].asCString());
545544
st_APPInfo.bEnable = st_JsonArray[i]["bEnable"].asBool();
546545
st_APPInfo.nReTime = st_JsonArray[i]["nAPPReTime"].asInt();
546+
st_APPInfo.nReNumber = st_JsonArray[i]["nAPPReNumber"].asInt();
547547

548548
pSt_AppConfig->stl_ListDeamonApp.push_back(st_APPInfo);
549549
}

XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Deamon.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,10 @@ void CALLBACK HTTPTask_TaskPost_Thread()
1212
{
1313
continue;
1414
}
15-
//重试次数判断
16-
if (stl_ListIterator->nErrorTime > st_ServiceConfig.st_XTime.nDeamonTime)
17-
{
18-
stl_ListIterator->bEnable = false;
19-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("服务名:%s,由于超过指定启动失败次数:%d,这个服务检测功能被关闭..."), stl_ListIterator->tszAPPName, st_ServiceConfig.st_XTime.nDeamonTime);
20-
continue;
21-
}
2215
if (stl_ListIterator->nErrorTime >= stl_ListIterator->nReNumber)
2316
{
2417
stl_ListIterator->bEnable = false;
25-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("服务名:%s,由于超过指定启动失败次数:%d,这个服务检测功能被关闭..."), stl_ListIterator->tszAPPName, st_ServiceConfig.st_XTime.nDeamonTime);
18+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("服务名:%s,由于超过指定启动失败次数:%d,这个服务检测功能被关闭..."), stl_ListIterator->tszAPPName, stl_ListIterator->nReNumber);
2619
continue;
2720
}
2821

@@ -46,7 +39,8 @@ void CALLBACK HTTPTask_TaskPost_Thread()
4639
}
4740
else
4841
{
49-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("自动重启,重启进程:%s 失败,错误码:%lX..."), stl_ListIterator->tszAPPName, SystemApi_GetLastError());
42+
stl_ListIterator->bEnable = false;
43+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("自动重启,重启进程:%s 失败,此服务将被禁用,错误码:%lX..."), stl_ListIterator->tszAPPName, SystemApi_GetLastError());
5044
}
5145
stl_ListIterator->nErrorTime++;
5246
}
@@ -84,7 +78,8 @@ void CALLBACK HTTPTask_TaskPost_Thread()
8478
}
8579
else
8680
{
87-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, "崩溃重启,检查到进程不存在,启动进程:%s 失败,错误码:%lX...", stl_ListIterator->tszAPPName, SystemApi_GetLastError());
81+
stl_ListIterator->bEnable = false;
82+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, "崩溃重启,检查到进程不存在,启动进程:%s 失败,此服务将被禁用,错误码:%lX...", stl_ListIterator->tszAPPName, SystemApi_GetLastError());
8883
}
8984
stl_ListIterator->nErrorTime++;
9085
}

0 commit comments

Comments
 (0)