Improve provider logs
This commit is contained in:
parent
0d81fac3fc
commit
c57876c116
11 changed files with 22 additions and 26 deletions
|
@ -85,7 +85,7 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe.
|
|||
|
||||
err := p.watchKv(ctxLog, configurationChan)
|
||||
if err != nil {
|
||||
logger.Error().Err(err).Msg("Cannot watch KV store")
|
||||
logger.Error().Err(err).Msg("Cannot retrieve data")
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -124,15 +124,11 @@ func (p *Provider) watchKv(ctx context.Context, configurationChan chan<- dynamic
|
|||
}
|
||||
|
||||
notify := func(err error, time time.Duration) {
|
||||
log.Ctx(ctx).Error().Err(err).Msgf("KV connection error, retrying in %s", time)
|
||||
log.Ctx(ctx).Error().Err(err).Msgf("Provider error, retrying in %s", time)
|
||||
}
|
||||
|
||||
err := backoff.RetryNotify(safe.OperationWithRecover(operation),
|
||||
return backoff.RetryNotify(safe.OperationWithRecover(operation),
|
||||
backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctx), notify)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot connect to KV server: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Provider) buildConfiguration(ctx context.Context) (*dynamic.Configuration, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue