MCPcopy Create free account
hub / github.com/cortexproject/cortex / discoverUsersWithRetries

Method discoverUsersWithRetries

pkg/compactor/compactor.go:1123–1144  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

1121}
1122
1123func (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.
1147func (c *Compactor) discoverUsers(ctx context.Context) ([]string, error) {

Callers 1

compactUsersMethod · 0.95

Calls 4

discoverUsersMethod · 0.95
NewFunction · 0.92
OngoingMethod · 0.80
WaitMethod · 0.45

Tested by

no test coverage detected