(tenantID string, blockID uuid.UUID, jitter bool)
| 250 | } |
| 251 | |
| 252 | func (s *LiveStore) enqueueCompleteOp(tenantID string, blockID uuid.UUID, jitter bool) error { |
| 253 | op := &completeOp{ |
| 254 | tenantID: tenantID, |
| 255 | blockID: blockID, |
| 256 | // Initial priority and backoff |
| 257 | at: time.Now(), |
| 258 | bo: s.cfg.initialBackoff, |
| 259 | maxBackoff: s.cfg.maxBackoff, |
| 260 | } |
| 261 | |
| 262 | if jitter { |
| 263 | return s.enqueueOpWithJitter(op) |
| 264 | } |
| 265 | |
| 266 | return s.enqueueOp(op) |
| 267 | } |
| 268 | |
| 269 | func (s *LiveStore) enqueueOpWithJitter(op *completeOp) error { |
| 270 | delay := time.Duration(rand.Int64N(10_000) * int64(time.Millisecond)) //gosec:disable G404 — It doesn't require strong randomness |
no test coverage detected