From 02013a2ac512a1801ff130b9cd11d69c738e535e Mon Sep 17 00:00:00 2001 From: ruotiantang Date: Fri, 1 Dec 2023 11:14:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96GoAgent=E5=AF=B9=E4=BA=8E?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E8=B5=84=E6=BA=90=E5=8D=A0=E7=94=A8=20#9597?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devops/common/api/pojo/agent/AgentErrorExitData.kt | 9 +-------- .../service/thirdPartyAgent/ThirdPartyAgentMgrService.kt | 5 ++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/pojo/agent/AgentErrorExitData.kt b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/pojo/agent/AgentErrorExitData.kt index e979d260448..9802c931486 100644 --- a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/pojo/agent/AgentErrorExitData.kt +++ b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/pojo/agent/AgentErrorExitData.kt @@ -1,13 +1,6 @@ package com.tencent.devops.common.api.pojo.agent data class AgentErrorExitData( - val errorEnum: AgentErrorExitErrorEnum, + val errorEnum: String, val message: String? ) - -enum class AgentErrorExitErrorEnum { - THIRD_AGENT_EXIT_NOT_WORKER, - THIRD_AGENT_EXIT_LEFT_DEVICE, - THIRD_AGENT_EXIT_PERMISSION_DENIED -} - diff --git a/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/service/thirdPartyAgent/ThirdPartyAgentMgrService.kt b/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/service/thirdPartyAgent/ThirdPartyAgentMgrService.kt index fc921a14100..d9e47b5cce7 100644 --- a/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/service/thirdPartyAgent/ThirdPartyAgentMgrService.kt +++ b/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/service/thirdPartyAgent/ThirdPartyAgentMgrService.kt @@ -38,7 +38,6 @@ import com.tencent.devops.common.api.exception.PermissionForbiddenException import com.tencent.devops.common.api.pojo.AgentResult import com.tencent.devops.common.api.pojo.OS import com.tencent.devops.common.api.pojo.Page -import com.tencent.devops.common.api.pojo.agent.AgentErrorExitErrorEnum import com.tencent.devops.common.api.pojo.agent.NewHeartbeatInfo import com.tencent.devops.common.api.util.ApiUtil import com.tencent.devops.common.api.util.DateTimeUtil @@ -236,8 +235,8 @@ class ThirdPartyAgentMgrService @Autowired(required = false) constructor( return tpad } - private fun trans(enum: AgentErrorExitErrorEnum, userId: String): String { - return MessageUtil.getMessageByLocale(enum.name, I18nUtil.getLanguage(userId)) + private fun trans(enum: String, userId: String): String { + return MessageUtil.getMessageByLocale(enum, I18nUtil.getLanguage(userId)) } private fun getAgentProperties(agentRecord: TEnvironmentThirdpartyAgentRecord): AgentProps? {