(authID string, next time.Time)
| 306 | } |
| 307 | |
| 308 | func (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 | |
| 324 | func (l *authAutoRefreshLoop) remove(authID string) { |
| 325 | if authID == "" { |
no test coverage detected