Merge pull request #760 from containous/fix-ProvidersThrottleDuration-doc

Fix providers throttle duration doc
This commit is contained in:
Emile Vauge 2016-10-26 14:20:10 +02:00 committed by GitHub
commit ddbddf6edf
3 changed files with 8 additions and 8 deletions

View file

@ -31,14 +31,14 @@
# #
# logLevel = "ERROR" # logLevel = "ERROR"
# Backends throttle duration: minimum duration between 2 events from providers # Backends throttle duration: minimum duration in seconds between 2 events from providers
# before applying a new configuration. It avoids unnecessary reloads if multiples events # before applying a new configuration. It avoids unnecessary reloads if multiples events
# are sent in a short amount of time. # are sent in a short amount of time.
# #
# Optional # Optional
# Default: "2s" # Default: "2"
# #
# ProvidersThrottleDuration = "5s" # ProvidersThrottleDuration = "5"
# If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used. # If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used.
# If you encounter 'too many open files' errors, you can either change this value, or change `ulimit` value. # If you encounter 'too many open files' errors, you can either change this value, or change `ulimit` value.

View file

@ -212,11 +212,11 @@ func (server *Server) listenProviders(stop chan bool) {
lastConfigs.Set(configMsg.ProviderName, &configMsg) lastConfigs.Set(configMsg.ProviderName, &configMsg)
lastReceivedConfigurationValue := lastReceivedConfiguration.Get().(time.Time) lastReceivedConfigurationValue := lastReceivedConfiguration.Get().(time.Time)
if time.Now().After(lastReceivedConfigurationValue.Add(time.Duration(server.globalConfiguration.ProvidersThrottleDuration))) { if time.Now().After(lastReceivedConfigurationValue.Add(time.Duration(server.globalConfiguration.ProvidersThrottleDuration))) {
log.Debugf("Last %s config received more than %s, OK", configMsg.ProviderName, server.globalConfiguration.ProvidersThrottleDuration) log.Debugf("Last %s config received more than %s, OK", configMsg.ProviderName, server.globalConfiguration.ProvidersThrottleDuration.String())
// last config received more than n s ago // last config received more than n s ago
server.configurationValidatedChan <- configMsg server.configurationValidatedChan <- configMsg
} else { } else {
log.Debugf("Last %s config received less than %s, waiting...", configMsg.ProviderName, server.globalConfiguration.ProvidersThrottleDuration) log.Debugf("Last %s config received less than %s, waiting...", configMsg.ProviderName, server.globalConfiguration.ProvidersThrottleDuration.String())
safe.Go(func() { safe.Go(func() {
<-time.After(server.globalConfiguration.ProvidersThrottleDuration) <-time.After(server.globalConfiguration.ProvidersThrottleDuration)
lastReceivedConfigurationValue := lastReceivedConfiguration.Get().(time.Time) lastReceivedConfigurationValue := lastReceivedConfiguration.Get().(time.Time)

View file

@ -30,14 +30,14 @@
# #
# logLevel = "ERROR" # logLevel = "ERROR"
# Backends throttle duration: minimum duration between 2 events from providers # Backends throttle duration: minimum duration in seconds between 2 events from providers
# before applying a new configuration. It avoids unnecessary reloads if multiples events # before applying a new configuration. It avoids unnecessary reloads if multiples events
# are sent in a short amount of time. # are sent in a short amount of time.
# #
# Optional # Optional
# Default: "2s" # Default: "2"
# #
# ProvidersThrottleDuration = "5s" # ProvidersThrottleDuration = "5"
# If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used. # If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used.
# If you encounter 'too many open files' errors, you can either change this value, or change `ulimit` value. # If you encounter 'too many open files' errors, you can either change this value, or change `ulimit` value.