v0.22.0 several enhancements and fixes for security, network, doc, test, packaging
Test / test (push) Canceled after 0s
Test / e2e (push) Canceled after 0s

This commit is contained in:
lixen committed 2026-10-03 14:52:16 -04:00
1 parent 9ab8c356d2
commit 71d1b82f83
102 files changed
+7102 -2178

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
package main
import (
"strings"
lconfig "github.com/lixenwraith/config"
)
// collectConfigChanges folds the queued hints into one snapshot read. Error
// events describe an unpublished edit and must not restart a healthy service.
func collectConfigChanges(first string, changes <-chan string) bool {
changed := reportConfigEvent(first)
// Bound the drain to the currently queued events so a busy writer cannot
// starve signal handling. Later events remain queued for the next iteration.
for remaining := len(changes); remaining > 0; remaining-- {
select {
case event, ok := <-changes:
if !ok {
return changed
}
changed = reportConfigEvent(event) || changed
default:
return changed
}
}
return changed
}
func reportConfigEvent(event string) bool {
if event == lconfig.EventFileDeleted || event == lconfig.EventPermissionsChanged ||
event == lconfig.EventReloadTimeout || strings.HasPrefix(event, lconfig.EventReloadError+":") {
logger.Warn("msg", "Configuration update not applied", "event", event, "action", "keeping current service")
return false
}
return event != ""
}