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