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

Method loadTokenFile

pkg/ring/lifecycler.go:411–424  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

409}
410
411func (i *Lifecycler) loadTokenFile() (*TokenFile, error) {
412
413 t, err := LoadTokenFile(i.cfg.TokensFilePath)
414 if err != nil {
415 return nil, err
416 }
417
418 i.stateMtx.Lock()
419 defer i.stateMtx.Unlock()
420
421 i.tokenFile = t
422 level.Info(i.logger).Log("msg", "loaded token file", "state", i.tokenFile.PreviousState, "num_tokens", len(i.tokenFile.Tokens), "path", i.cfg.TokensFilePath)
423 return i.tokenFile, nil
424}
425
426func (i *Lifecycler) getRegisteredAt() time.Time {
427 i.stateMtx.RLock()

Callers 1

initRingMethod · 0.95

Calls 2

LoadTokenFileFunction · 0.85
LogMethod · 0.45

Tested by

no test coverage detected