disable config file watch
This commit is contained in:
parent
6f70a6aab3
commit
32006e6598
@ -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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user