优化结构

This commit is contained in:
Yvan
2026-08-28 09:19:54 +08:00
parent 03a4131f6e
commit 279692375b
57 changed files with 778 additions and 799 deletions
+1 -17
View File
@@ -268,23 +268,7 @@ func (r *Store) watchLoop(watcher *fsnotify.Watcher, stop <-chan struct{}, done
// take down a running process or publish invalid state.
continue
}
current := r.Snapshot()
if next.Admin == nil {
next.Admin = &Admin{}
}
// Storage and Email move to database-backed integration settings after
// first initialization. External config file edits must not erase the
// active values when those sections are absent from config.yaml.
if current != nil && current.Admin != nil {
if next.Admin.Storage == nil {
next.Admin.Storage = cloneStorage(current.Admin.Storage)
}
if next.Admin.Email == nil && current.Admin.Email != nil {
email := *current.Admin.Email
next.Admin.Email = &email
}
}
r.Replace(next)
r.Replace(MergeRuntimeConfig(r.Snapshot(), next))
case _, ok := <-errors:
// fsnotify errors are intentionally non-fatal; the watcher remains
// useful for subsequent events and Close always terminates it.