mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-06 20:43:27 -05:00
go test -race on core/http/endpoints/localai reported data races between POST /api/settings and the goroutines that read the result: ApplyRuntimeSettings wrote chats_egress_audit_days and the chats_loop_* limits as plain fields while the audit prune and the loop runner read them through the Effective getters. Guard those six fields with one RWMutex, taken by the getters and by the registry setters. A new spec applies the settings while four goroutines read them and fails under -race without the lock. Assisted-by: Claude:claude-sonnet-5-5 go-test