MCPcopy Create free account
hub / github.com/cortexproject/cortex / deleteQueue

Method deleteQueue

pkg/scheduler/queue/user_queues.go:103–119  ·  view source on GitHub ↗
(userID string)

Source from the content-addressed store, hash-verified

101}
102
103func (q *queues) deleteQueue(userID string) {
104 q.queuesMx.Lock()
105 defer q.queuesMx.Unlock()
106
107 uq := q.userQueues[userID]
108 if uq == nil {
109 return
110 }
111
112 delete(q.userQueues, userID)
113 q.users[uq.index] = ""
114
115 // Shrink users list size if possible. This is safe, and no users will be skipped during iteration.
116 for ix := len(q.users) - 1; ix >= 0 && q.users[ix] == ""; ix-- {
117 q.users = q.users[:ix]
118 }
119}
120
121// Returns existing or new queue for user.
122// MaxQueriers is used to compute which queriers should handle requests for this user.

Callers 4

TestQueuesFunction · 0.80
TestQueuesConsistencyFunction · 0.80
TestQueueConcurrencyFunction · 0.80

Calls

no outgoing calls

Tested by 3

TestQueuesFunction · 0.64
TestQueuesConsistencyFunction · 0.64
TestQueueConcurrencyFunction · 0.64