mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-14 01:42:26 +08:00
格式化代码
This commit is contained in:
@@ -2,7 +2,6 @@ package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hk4e/gdconf"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
@@ -10,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"hk4e/common/config"
|
||||
"hk4e/gdconf"
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/dao"
|
||||
@@ -26,7 +26,7 @@ func Run(ctx context.Context, configFile string) error {
|
||||
config.InitConfig(configFile)
|
||||
|
||||
logger.InitLogger("gs")
|
||||
logger.LOG.Info("gs start")
|
||||
logger.Warn("gs start")
|
||||
|
||||
constant.InitConstant()
|
||||
|
||||
@@ -35,7 +35,7 @@ func Run(ctx context.Context, configFile string) error {
|
||||
|
||||
conn, err := nats.Connect(config.CONF.MQ.NatsUrl)
|
||||
if err != nil {
|
||||
logger.LOG.Error("connect nats error: %v", err)
|
||||
logger.Error("connect nats error: %v", err)
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
@@ -71,10 +71,10 @@ func Run(ctx context.Context, configFile string) error {
|
||||
case <-ctx.Done():
|
||||
return nil
|
||||
case s := <-c:
|
||||
logger.LOG.Info("get a signal %s", s.String())
|
||||
logger.Warn("get a signal %s", s.String())
|
||||
switch s {
|
||||
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
|
||||
logger.LOG.Info("gs exit")
|
||||
logger.Warn("gs exit")
|
||||
time.Sleep(time.Second)
|
||||
return nil
|
||||
case syscall.SIGHUP:
|
||||
|
||||
Reference in New Issue
Block a user