File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -56,19 +56,20 @@ func Init(rowVal *Config, path string) *viper.Viper {
5656 if err != nil {
5757 panic (fmt .Errorf ("Fatal error config file: %s \n " , err ))
5858 }
59- v .WatchConfig ()
60-
6159 /*
62- //监听配置修改没什么必要
63- v.OnConfigChange(func(e fsnotify.Event) {
64- //配置文件修改监听
65- fmt.Println("config file changed:", e.Name)
66- if err2 := v.Unmarshal(rowVal); err2 != nil {
67- fmt.Println(err2)
68- }
69- rowVal.Rustdesk.LoadKeyFile()
70- rowVal.Rustdesk.ParsePort()
71- })
60+ v.WatchConfig()
61+
62+
63+ //监听配置修改没什么必要
64+ v.OnConfigChange(func(e fsnotify.Event) {
65+ //配置文件修改监听
66+ fmt.Println("config file changed:", e.Name)
67+ if err2 := v.Unmarshal(rowVal); err2 != nil {
68+ fmt.Println(err2)
69+ }
70+ rowVal.Rustdesk.LoadKeyFile()
71+ rowVal.Rustdesk.ParsePort()
72+ })
7273 */
7374 if err := v .Unmarshal (rowVal ); err != nil {
7475 fmt .Println (err )
You can’t perform that action at this time.
0 commit comments