Fix small bugs across AI tools, fleet API, and run.bat.
Correct AI uptime/reinstall/sleep, broaden live stats over WebSocket, fix blueprint delete JSON, gate hollowing behind build tag, and stop stale server binds on restart.
This commit is contained in:
@@ -114,14 +114,10 @@ func (h *AIHandler) RemoveEngine(agentID string) {
|
||||
|
||||
// GetEngine returns the engine for an agent.
|
||||
func (h *AIHandler) GetEngine(agentID string) *ollama.Engine {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
h.mu.Lock()
|
||||
defer h.mu.Unlock()
|
||||
if entry, ok := h.engines[agentID]; ok {
|
||||
h.mu.RUnlock() // Briefly unlock to update timestamp
|
||||
h.mu.Lock()
|
||||
entry.lastUsed = time.Now()
|
||||
h.mu.Unlock()
|
||||
h.mu.RLock()
|
||||
return entry.engine
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user