[optimize] watchReload close the DB connections
This commit is contained in:
parent
9a54e15ae9
commit
63f9e6574d
1 changed files with 7 additions and 1 deletions
|
|
@ -251,7 +251,13 @@ func watchReload(root string, file string, event string, cfg config.Config) {
|
||||||
|
|
||||||
switch event {
|
switch event {
|
||||||
case "CREATE", "WRITE", "REMOVE":
|
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 {
|
if err != nil {
|
||||||
fmt.Println(color.RedString("[Watch] Reload: %s", err.Error()))
|
fmt.Println(color.RedString("[Watch] Reload: %s", err.Error()))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue