perf(watcher): remove redundant auth clones in incremental path

This commit is contained in:
lyd123qw2008
2026-03-01 14:05:11 +08:00
parent 9a37defed3
commit 30338ecec4

View File

@@ -106,7 +106,7 @@ func (w *Watcher) reloadClients(rescanAuth bool, affectedOAuthProviders []string
if a == nil || strings.TrimSpace(a.ID) == "" {
continue
}
pathAuths[a.ID] = a.Clone()
pathAuths[a.ID] = a
}
if len(pathAuths) > 0 {
w.fileAuthsByPath[normalizedPath] = pathAuths
@@ -218,7 +218,7 @@ func (w *Watcher) addOrUpdateClient(path string) {
if a == nil || strings.TrimSpace(a.ID) == "" {
continue
}
newByID[a.ID] = a.Clone()
newByID[a.ID] = a
}
if len(newByID) > 0 {
w.fileAuthsByPath[normalized] = newByID