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

Method upsert

sdk/cliproxy/auth/auto_refresh_loop.go:308–322  ·  view source on GitHub ↗
(authID string, next time.Time)

Source from the content-addressed store, hash-verified

306}
307
308func (l *authAutoRefreshLoop) upsert(authID string, next time.Time) {
309 if authID == "" || next.IsZero() {
310 return
311 }
312 l.mu.Lock()
313 defer l.mu.Unlock()
314 if item, ok := l.index[authID]; ok && item != nil {
315 item.next = next
316 heap.Fix(&l.queue, item.index)
317 return
318 }
319 item := &refreshHeapItem{id: authID, next: next}
320 heap.Push(&l.queue, item)
321 l.index[authID] = item
322}
323
324func (l *authAutoRefreshLoop) remove(authID string) {
325 if authID == "" {

Callers 2

handleDueAuthMethod · 0.95
applyDirtyMethod · 0.95

Calls 1

PushMethod · 0.80

Tested by

no test coverage detected