fix(client): Prevent overwriting auth file on update

This commit is contained in:
hkfires
2025-09-18 22:43:33 +08:00
parent d9f8129a32
commit f17ec7ffd8
4 changed files with 33 additions and 17 deletions

View File

@@ -465,7 +465,7 @@ func (w *Watcher) addOrUpdateClient(path string) {
if _, canUnregister := any(oldClient).(interface{ UnregisterClient() }); canUnregister {
log.Debugf("unregistering old client for updated file: %s", filepath.Base(path))
}
unregisterClientWithReason(oldClient, interfaces.UnregisterReasonReload)
unregisterClientWithReason(oldClient, interfaces.UnregisterReasonAuthFileUpdated)
}
// Create new client (reads the file again internally; this is acceptable as the files are small and it keeps the change minimal)