(tokens Tokens)
| 388 | } |
| 389 | |
| 390 | func (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 | |
| 402 | func (i *Lifecycler) getRegisteredAt() time.Time { |
| 403 | i.stateMtx.RLock() |