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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user