From 32006e65985004d5132fe0b0807f598913bccc05 Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Thu, 9 Dec 2021 18:14:28 +0100 Subject: [PATCH] disable config file watch --- src/config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/config.go b/src/config.go index 06f9896..b69de71 100644 --- a/src/config.go +++ b/src/config.go @@ -3,9 +3,7 @@ package main import ( "fmt" - "git.openpdu.org/OpenPDU/openpdu/events" "git.openpdu.org/OpenPDU/openpdu/syslog" - "github.com/fsnotify/fsnotify" "github.com/spf13/viper" ) @@ -18,10 +16,12 @@ func init() { if err != nil { // Handle errors reading the config file syslog.Err(fmt.Sprintf("Can't read config file: %s \n", err.Error())) } - viper.OnConfigChange(func(e fsnotify.Event) { - //The Viper configuration has changed to perform the responding operation - fmt.Println("Config file changed:", e.Name) - events.FireEvent("config_changed") - }) - viper.WatchConfig() + + // temporary disabled because it screwsup the config on save + // viper.OnConfigChange(func(e fsnotify.Event) { + // //The Viper configuration has changed to perform the responding operation + // fmt.Println("Config file changed:", e.Name) + // events.FireEvent("config_changed") + // }) + // viper.WatchConfig() }