|
@@ -56,9 +56,7 @@ func (daemon *Daemon) Reload(conf *config.Config) (err error) {
|
|
|
}
|
|
|
daemon.reloadDebug(conf, attributes)
|
|
|
daemon.reloadMaxConcurrentDownloadsAndUploads(conf, attributes)
|
|
|
- if err := daemon.reloadMaxDownloadAttempts(conf, attributes); err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
+ daemon.reloadMaxDownloadAttempts(conf, attributes)
|
|
|
daemon.reloadShutdownTimeout(conf, attributes)
|
|
|
daemon.reloadFeatures(conf, attributes)
|
|
|
|
|
@@ -124,23 +122,17 @@ func (daemon *Daemon) reloadMaxConcurrentDownloadsAndUploads(conf *config.Config
|
|
|
|
|
|
// reloadMaxDownloadAttempts updates configuration with max concurrent
|
|
|
// download attempts when a connection is lost and updates the passed attributes
|
|
|
-func (daemon *Daemon) reloadMaxDownloadAttempts(conf *config.Config, attributes map[string]string) error {
|
|
|
- if err := config.ValidateMaxDownloadAttempts(conf); err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
-
|
|
|
- // If no value is set for max-download-attempts we assume it is the default value
|
|
|
+func (daemon *Daemon) reloadMaxDownloadAttempts(conf *config.Config, attributes map[string]string) {
|
|
|
// We always "reset" as the cost is lightweight and easy to maintain.
|
|
|
maxDownloadAttempts := config.DefaultDownloadAttempts
|
|
|
if conf.IsValueSet("max-download-attempts") && conf.MaxDownloadAttempts != nil {
|
|
|
maxDownloadAttempts = *conf.MaxDownloadAttempts
|
|
|
}
|
|
|
daemon.configStore.MaxDownloadAttempts = &maxDownloadAttempts
|
|
|
- logrus.Debugf("Reset Max Download Attempts: %d", *daemon.configStore.MaxDownloadAttempts)
|
|
|
|
|
|
// prepare reload event attributes with updatable configurations
|
|
|
attributes["max-download-attempts"] = fmt.Sprintf("%d", *daemon.configStore.MaxDownloadAttempts)
|
|
|
- return nil
|
|
|
+ logrus.Debug("Reset Max Download Attempts: ", attributes["max-download-attempts"])
|
|
|
}
|
|
|
|
|
|
// reloadShutdownTimeout updates configuration with daemon shutdown timeout option
|