From 5a284b4c24cd2356928bb3572e6d459bb0f4799d Mon Sep 17 00:00:00 2001 From: Christian Claus Date: Tue, 1 May 2018 20:28:33 +0200 Subject: [PATCH] Add subdir configuration to configuration live reload --- app/config.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/config.go b/app/config.go index 76a0b58..3b305c6 100644 --- a/app/config.go +++ b/app/config.go @@ -99,14 +99,10 @@ func (cfg *Config) updateConfig(e fsnotify.Event) { r := recover() switch t := r.(type) { case string: - err = errors.New(t) + log.WithError(errors.New(t)).Error("Error updating configuration. Please restart the server...") case error: - err = t - default: - err = errors.New("Unknown error") + log.WithError(t).Error("Error updating configuration. Please restart the server...") } - - log.WithError(err).Error("Error updating configuration. Please restart the server...") }() log.WithField("path", e.Name).Info("Config file changed") @@ -136,6 +132,10 @@ func (cfg *Config) updateConfig(e fsnotify.Event) { log.WithField("user", username).Info("Updated password of user") cfg.Users[username].Password = v.Password } + if cfg.Users[username].Subdir != v.Subdir { + log.WithField("user", username).Info("Updated subdir of user") + cfg.Users[username].Subdir = v.Subdir + } } }