MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / calculateQueueDeadlineAndSleep

Method calculateQueueDeadlineAndSleep

scope.go:201–213  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

199}
200
201func (s *scope) calculateQueueDeadlineAndSleep() (time.Duration, time.Time) {
202 d := s.maxQueueTime()
203 dSleep := d / 10
204 if dSleep > time.Second {
205 dSleep = time.Second
206 }
207 if dSleep < time.Millisecond {
208 dSleep = time.Millisecond
209 }
210 deadline := time.Now().Add(d)
211
212 return dSleep, deadline
213}
214
215func (s *scope) inc() error {
216 uQueries := s.user.queryCounter.inc()

Callers 1

incQueuedMethod · 0.95

Calls 1

maxQueueTimeMethod · 0.95

Tested by

no test coverage detected