refactor: introduce Pool interface, move agent_pool to agent module

This commit is contained in:
yusing
2025-04-13 06:11:06 +08:00
parent 12a63a66f6
commit 90214ff752
13 changed files with 132 additions and 91 deletions

View File

@@ -40,7 +40,7 @@ func NewAgent(w http.ResponseWriter, r *http.Request) {
return
}
hostport := fmt.Sprintf("%s:%d", host, port)
if _, ok := config.GetInstance().GetAgent(hostport); ok {
if _, ok := agent.Agents.Get(hostport); ok {
gphttp.ClientError(w, gphttp.ErrAlreadyExists("agent", hostport), http.StatusConflict)
return
}