优化代码

This commit is contained in:
flswld
2023-02-18 22:09:59 +08:00
parent 21fb9d400f
commit e580baeb46
37 changed files with 198 additions and 118 deletions

View File

@@ -6,7 +6,6 @@ import (
"os"
"os/signal"
"syscall"
"time"
"hk4e/common/config"
"hk4e/common/rpc"
@@ -20,6 +19,9 @@ func Run(ctx context.Context, configFile string) error {
logger.InitLogger("dispatch")
logger.Warn("dispatch start")
defer func() {
logger.CloseLogger()
}()
db := dao.NewDao()
defer db.CloseDao()
@@ -43,8 +45,6 @@ func Run(ctx context.Context, configFile string) error {
switch s {
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
logger.Warn("dispatch exit")
time.Sleep(time.Second)
return nil
case syscall.SIGHUP:
default: