Serialize settings applies; log fallback save error
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user