refactor(auth): simplify auth directory scanning and improve JSON processing logic
- Replaced `filepath.Walk` with `os.ReadDir` for cleaner directory traversal. - Fixed `isAuthJSON` check to use `filepath.Dir` for directory comparison. - Updated auth hash cache generation and file synthesis to improve readability and maintainability.
This commit is contained in:
@@ -2903,19 +2903,19 @@ func (m *Manager) StartAutoRefresh(parent context.Context, interval time.Duratio
|
||||
}
|
||||
|
||||
m.mu.Lock()
|
||||
cancel := m.refreshCancel
|
||||
cancelPrev := m.refreshCancel
|
||||
m.refreshCancel = nil
|
||||
m.refreshLoop = nil
|
||||
m.mu.Unlock()
|
||||
if cancel != nil {
|
||||
cancel()
|
||||
if cancelPrev != nil {
|
||||
cancelPrev()
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(parent)
|
||||
ctx, cancelCtx := context.WithCancel(parent)
|
||||
loop := newAuthAutoRefreshLoop(m, interval)
|
||||
|
||||
m.mu.Lock()
|
||||
m.refreshCancel = cancel
|
||||
m.refreshCancel = cancelCtx
|
||||
m.refreshLoop = loop
|
||||
m.mu.Unlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user