MCPcopy Index your code
hub / github.com/coder/coder / skipRecord

Method skipRecord

enterprise/aiseats/tracker.go:56–62  ·  view source on GitHub ↗

skipRecord returns true when the user is still in the retry cooldown window and we should skip a DB write attempt.

(userID uuid.UUID, now time.Time)

Source from the content-addressed store, hash-verified

54// skipRecord returns true when the user is still in the retry cooldown
55// window and we should skip a DB write attempt.
56func (t *SeatTracker) skipRecord(userID uuid.UUID, now time.Time) bool {
57 t.mu.RLock()
58 defer t.mu.RUnlock()
59
60 retryAfter, ok := t.retryAfter[userID]
61 return ok && now.Before(retryAfter)
62}
63
64// recordThrottle sets the next time when DB writes for this user are allowed.
65func (t *SeatTracker) recordThrottle(userID uuid.UUID, now time.Time, d time.Duration) {

Callers 1

RecordUsageMethod · 0.95

Implementers 2

Noopcoderd/aiseats/aiseats.go
SeatTrackerenterprise/aiseats/tracker.go

Calls

no outgoing calls

Tested by

no test coverage detected