Skip to content

Commit

Permalink
优化GoAgent对于后台资源占用 #9597
Browse files Browse the repository at this point in the history
  • Loading branch information
tangruotian committed Dec 1, 2023
1 parent ed445f6 commit 02013a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -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
}

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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? {
Expand Down

0 comments on commit 02013a2

Please sign in to comment.