disable config file watch
This commit is contained in:
parent
6f70a6aab3
commit
32006e6598
@ -3,9 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"git.openpdu.org/OpenPDU/openpdu/events"
|
|
||||||
"git.openpdu.org/OpenPDU/openpdu/syslog"
|
"git.openpdu.org/OpenPDU/openpdu/syslog"
|
||||||
"github.com/fsnotify/fsnotify"
|
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -18,10 +16,12 @@ func init() {
|
|||||||
if err != nil { // Handle errors reading the config file
|
if err != nil { // Handle errors reading the config file
|
||||||
syslog.Err(fmt.Sprintf("Can't read config file: %s \n", err.Error()))
|
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
|
// temporary disabled because it screwsup the config on save
|
||||||
fmt.Println("Config file changed:", e.Name)
|
// viper.OnConfigChange(func(e fsnotify.Event) {
|
||||||
events.FireEvent("config_changed")
|
// //The Viper configuration has changed to perform the responding operation
|
||||||
})
|
// fmt.Println("Config file changed:", e.Name)
|
||||||
viper.WatchConfig()
|
// events.FireEvent("config_changed")
|
||||||
|
// })
|
||||||
|
// viper.WatchConfig()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user