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 + } } }