Serialize settings applies; log fallback save error

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 20:24:17 -04:00
parent 324aa3ebce
commit 326990d69a
3 changed files with 6 additions and 1 deletions
+2
View File
@@ -40,6 +40,8 @@ func (s *Server) handlePostSettings(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid json"})
return
}
s.applyMu.Lock()
defer s.applyMu.Unlock()
s.settingsMu.Lock()
apply := s.applyFn
path := s.settingsPath
+1
View File
@@ -35,6 +35,7 @@ type Server struct {
settings settings.Settings
settingsPath string
applyFn func(settings.Settings) error
applyMu sync.Mutex // serializes POST /settings apply+save
}
func NewServer(ctrl *session.Controller) *Server {