(ctx context.Context, dur time.Duration)
| 388 | } |
| 389 | |
| 390 | func (c *commandRepositoryUpgrade) sleepWithContext(ctx context.Context, dur time.Duration) bool { |
| 391 | t := time.NewTimer(dur) |
| 392 | defer t.Stop() |
| 393 | |
| 394 | stop := make(chan struct{}) |
| 395 | |
| 396 | c.svc.onTerminate(func() { close(stop) }) |
| 397 | |
| 398 | select { |
| 399 | case <-ctx.Done(): |
| 400 | return false |
| 401 | case <-stop: |
| 402 | return false |
| 403 | case <-t.C: |
| 404 | return true |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | func (c *commandRepositoryUpgrade) drainAllClients(ctx context.Context, rep repo.DirectRepositoryWriter) error { |
| 409 | for { |
no test coverage detected