MCPcopy
hub / github.com/grafana/dskit / setTokens

Method setTokens

ring/lifecycler.go:390–400  ·  view source on GitHub ↗
(tokens Tokens)

Source from the content-addressed store, hash-verified

388}
389
390func (i *Lifecycler) setTokens(tokens Tokens) {
391 i.stateMtx.Lock()
392 defer i.stateMtx.Unlock()
393
394 i.tokens = tokens
395 if i.cfg.TokensFilePath != "" {
396 if err := i.tokens.StoreToFile(i.cfg.TokensFilePath); err != nil {
397 level.Error(i.logger).Log("msg", "error storing tokens to disk", "path", i.cfg.TokensFilePath, "err", err)
398 }
399 }
400}
401
402func (i *Lifecycler) getRegisteredAt() time.Time {
403 i.stateMtx.RLock()

Callers 5

ClaimTokensForMethod · 0.95
initRingMethod · 0.95
verifyTokensMethod · 0.95
autoJoinMethod · 0.95

Calls 3

StoreToFileMethod · 0.80
LogMethod · 0.45
ErrorMethod · 0.45

Tested by 1