(ctx context.Context)
| 1121 | } |
| 1122 | |
| 1123 | func (c *Compactor) discoverUsersWithRetries(ctx context.Context) ([]string, error) { |
| 1124 | var lastErr error |
| 1125 | |
| 1126 | retries := backoff.New(ctx, backoff.Config{ |
| 1127 | MinBackoff: c.compactorCfg.retryMinBackoff, |
| 1128 | MaxBackoff: c.compactorCfg.retryMaxBackoff, |
| 1129 | MaxRetries: c.compactorCfg.CompactionRetries, |
| 1130 | }) |
| 1131 | |
| 1132 | for retries.Ongoing() { |
| 1133 | var users []string |
| 1134 | |
| 1135 | users, lastErr = c.discoverUsers(ctx) |
| 1136 | if lastErr == nil { |
| 1137 | return users, nil |
| 1138 | } |
| 1139 | |
| 1140 | retries.Wait() |
| 1141 | } |
| 1142 | |
| 1143 | return nil, lastErr |
| 1144 | } |
| 1145 | |
| 1146 | // discoverUsers returns all users that are active and deleting. Deleted users are not included. |
| 1147 | func (c *Compactor) discoverUsers(ctx context.Context) ([]string, error) { |
no test coverage detected