Merge pull request #315 from trheyi/main

[optimize] watchReload close the DB connections
This commit is contained in:
Max 2023-01-16 16:19:16 +08:00 committed by GitHub
commit 1ed985f8d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()))
}