Merge pull request #315 from trheyi/main
[optimize] watchReload close the DB connections
This commit is contained in:
commit
1ed985f8d8
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 {
|
||||
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()))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue