MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / newAuthAutoRefreshLoop

Function newAuthAutoRefreshLoop

sdk/cliproxy/auth/auto_refresh_loop.go:27–47  ·  view source on GitHub ↗
(manager *Manager, interval time.Duration, concurrency int)

Source from the content-addressed store, hash-verified

25}
26
27func newAuthAutoRefreshLoop(manager *Manager, interval time.Duration, concurrency int) *authAutoRefreshLoop {
28 if interval <= 0 {
29 interval = refreshCheckInterval
30 }
31 if concurrency <= 0 {
32 concurrency = refreshMaxConcurrency
33 }
34 jobBuffer := concurrency * 4
35 if jobBuffer < 64 {
36 jobBuffer = 64
37 }
38 return &authAutoRefreshLoop{
39 manager: manager,
40 interval: interval,
41 concurrency: concurrency,
42 index: make(map[string]*refreshHeapItem),
43 dirty: make(map[string]struct{}),
44 wakeCh: make(chan struct{}, 1),
45 jobs: make(chan string, jobBuffer),
46 }
47}
48
49func (l *authAutoRefreshLoop) queueReschedule(authID string) {
50 if l == nil || authID == "" {

Callers 2

StartAutoRefreshMethod · 0.85

Calls

no outgoing calls