fixup: pass pointer to pool

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2025-03-23 11:53:36 +01:00
parent 3a9169bdbe
commit fa25e7c077

View File

@@ -158,12 +158,14 @@ func (a *AgentPool) CreateAgent(name string, agentConfig *AgentConfig) error {
return err return err
} }
go func(ac AgentConfig) { defer func(ac AgentConfig, pool *AgentPool) {
// Create the agent avatar go func(ac AgentConfig, pool *AgentPool) {
if err := a.createAgentAvatar(ac); err != nil { // Create the agent avatar
xlog.Error("Failed to create agent avatar", "error", err) if err := a.createAgentAvatar(ac); err != nil {
} xlog.Error("Failed to create agent avatar", "error", err)
}(*agentConfig) }
}(ac, pool)
}(*agentConfig, a)
return a.startAgentWithConfig(name, agentConfig) return a.startAgentWithConfig(name, agentConfig)
} }