更新gf版本到v2.2.4

This commit is contained in:
孟帅
2022-11-25 23:22:44 +08:00
parent 29bda0dcdd
commit e990ce28a1
9 changed files with 107 additions and 48 deletions

View File

@@ -8,11 +8,10 @@ package cmd
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gproc"
"github.com/gogf/gf/v2/os/grpool"
"hotgo/internal/crons"
"hotgo/internal/websocket"
"hotgo/utility/simple"
"os"
)
@@ -29,12 +28,9 @@ func signalHandlerForOverall(sig os.Signal) {
}
func signalListen(ctx context.Context, handler ...gproc.SigHandler) {
err := grpool.AddWithRecover(ctx, func(ctx context.Context) {
simple.SafeGo(ctx, func(ctx context.Context) {
gproc.AddSigHandlerShutdown(handler...)
gproc.Listen()
})
if err != nil {
g.Log().Fatal(ctx, "signalListen Fatal:", err)
return
}
}