Browse Source

Z991239-5575 #comment delete no use code

oilyang 1 year ago
parent
commit
34b2c81c6b

+ 0 - 94
Module/mod_healthmanager/mod_healthmanager.cpp

@@ -1384,100 +1384,6 @@ namespace
 	}
 }
 
-ErrorCodeEnum CHealthManagerEntity::DealSpecifiedEntity(DealType type, LPCTSTR lpcszEntityName, LPCTSTR lpcszCmdline, bool bForce, CSimpleStringA& strErrMsg)
-{
-	ErrorCodeEnum result(Error_Succeed);
-	strErrMsg.Clear();
-
-	switch (type) {
-	case Deal_Start:
-	{
-		CSmartPointer<IEntityFunction> pFunc = GetFunction();
-		CSmartPointer<IEntityFunctionPrivilege> pFuncPrivilege = pFunc.ConvertCase<IEntityFunctionPrivilege>();
-		CSimpleStringA strEntityName(lpcszEntityName);
-		CEntityRunInfo info = {};
-		result = GetFunction()->GetEntityRunInfo(strEntityName, info);
-		bool toStart(true);
-		Dbg("entity: %s, %s,%s", strEntityName.GetData(), SpStrError(result), SpStrEntityState(info.eState));
-		if ((info.eState != EntityState_NoStart && info.eState == EntityState_Lost
-			&& info.eState == EntityState_Close && info.eState == EntityState_UnLoading)
-			&& (bForce)) {
-
-		}
-
-		if (info.eState != EntityState_NoStart && bForce) {
-			Dbg("to terminal entity..");
-			CSmartPointer<IAsynWaitSp> spWait;
-			result = pFuncPrivilege->StopEntity(strEntityName, spWait);
-			Dbg("stop entity return %s", SpStrError(result));
-			if (result == Error_Succeed && spWait != NULL) {
-				Dbg("to wait after stop...");
-				result = spWait->WaitAnswer(60 * 1000);
-				Dbg("wait result: %s", SpStrError(result));
-				if (result != Error_Succeed) {
-					CSmartPointer<IAsynWaitSp> spWait2;
-					result = pFuncPrivilege->TerminateEntity(strEntityName, spWait2);
-					Dbg("terminal entity return %s", SpStrError(result));
-					if (result == Error_Succeed && spWait2 != NULL) {
-						Dbg("to wait after terminal...");
-						result = spWait2->WaitAnswer(60 * 1000);
-						Dbg("wait result: %s", SpStrError(result));
-					}
-				}
-			}
-
-			if (result != Error_Succeed) {
-				strErrMsg = CSimpleStringA::Format("重启前停止实体失败 %s, %s", SpStrEntityState(info.eState), SpStrError(result));
-				toStart = false;
-			}
-		}
-		else if (info.eState != EntityState_NoStart) {
-			result = Error_InvalidState;
-			strErrMsg = CSimpleStringA::Format("实体[%s]当前状态(%s)不支持该操作", strEntityName.GetData(), SpStrEntityState(info.eState));
-			toStart = false;
-		}
-
-		if (toStart) {
-			Dbg("to start entity..");
-			CSmartPointer<IAsynWaitSp> spWait;
-			result = pFuncPrivilege->StartEntity(strEntityName, lpcszCmdline, spWait);
-			Dbg("start entity return %s", SpStrError(result));
-			if (result == Error_Succeed && spWait != NULL) {
-				Dbg("to wait...");
-				result = spWait->WaitAnswer(60 * 1000);
-				Dbg("wait result: %s", SpStrError(result));
-			}
-			if (result != Error_Succeed) {
-				strErrMsg = CSimpleStringA::Format("启动实体失败 %s", SpStrError(result));
-			}
-		}
-	}
-	break;
-	case Deal_Close:
-		result = Error_NotImpl;
-		break;
-	case Deal_Pause:
-		result = Error_NotImpl;
-		break;
-	case Deal_Continue:
-		result = Error_NotImpl;
-		break;
-	case Deal_Kill:
-		result = Error_NotImpl;
-		break;
-	case Deal_Test:
-		result = Error_NotImpl;
-		break;
-	case Deal_Restart:
-		result = Error_NotImpl;
-		break;
-	default:
-		result = Error_NotSupport;
-		break;
-	}
-	return result;
-}
-
 bool CHealthManagerEntity::IsTestMode()
 {
 	static int flag = -1;

+ 0 - 11
Module/mod_healthmanager/mod_healthmanager.h

@@ -30,16 +30,6 @@ typedef ErrorCodeEnum (*pfFrameworkQuit)(RebootTriggerEnum eReason);
 #define DEPLOYSTATE_DONE 1
 #define DEPLOYSTATE_FAILED 2
 
-enum DealType
-{
-    Deal_Start = 1,
-    Deal_Close,
-    Deal_Pause,
-    Deal_Continue,
-    Deal_Kill,
-    Deal_Test,
-    Deal_Restart
-};
 
 struct ModuleRunInfo
 {
@@ -297,7 +287,6 @@ private:
 
 	bool IsTestMode();
 
-	ErrorCodeEnum DealSpecifiedEntity(DealType type, LPCTSTR lpcszEntityName, LPCTSTR lpcszCmdline, bool bForce, CSimpleStringA& strErrMsg);
 	void ToCalcRebootHourAndMinute(int restartBegin, int restartEnd);
 };
 #endif // __MOD_HEALTHMANAGER_H