()
| 199 | } |
| 200 | |
| 201 | func (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 | |
| 215 | func (s *scope) inc() error { |
| 216 | uQueries := s.user.queryCounter.inc() |