[optimize] watchReload close the DB connections

This commit is contained in:
Max 2023-01-16 16:13:11 +08:00
parent 9a54e15ae9
commit 63f9e6574d

View file

@ -251,7 +251,13 @@ func watchReload(root string, file string, event string, cfg config.Config) {
switch event {
case "CREATE", "WRITE", "REMOVE":
err := engine.Load(config.Conf) // 加载脚本等
err := share.DBClose()
if err != nil {
fmt.Println(color.RedString("[Watch] Reload: %s", err.Error()))
}
err = engine.Load(config.Conf) // 加载脚本等
if err != nil {
fmt.Println(color.RedString("[Watch] Reload: %s", err.Error()))
}