feat(auth): add configurable worker pool size for auto-refresh loop

- Introduced `auth-auto-refresh-workers` config option to override default concurrency.
- Updated `authAutoRefreshLoop` to support customizable worker counts.
- Enhanced token refresh scheduling flexibility by aligning worker pool with runtime configurations.
This commit is contained in:
Luis Pater
2026-04-12 13:56:05 +08:00
parent 6c0a1efd71
commit 5bfaf8086b
4 changed files with 33 additions and 12 deletions
+5 -1
View File
@@ -2912,7 +2912,11 @@ func (m *Manager) StartAutoRefresh(parent context.Context, interval time.Duratio
}
ctx, cancelCtx := context.WithCancel(parent)
loop := newAuthAutoRefreshLoop(m, interval)
workers := refreshMaxConcurrency
if cfg, ok := m.runtimeConfig.Load().(*internalconfig.Config); ok && cfg != nil && cfg.AuthAutoRefreshWorkers > 0 {
workers = cfg.AuthAutoRefreshWorkers
}
loop := newAuthAutoRefreshLoop(m, interval, workers)
m.mu.Lock()
m.refreshCancel = cancelCtx