You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"fmt"
"os"
"time"
"github.com/gogf/gf/v2/os/gproc"
)
func signalHandlerForMQ(sig os.Signal) {
fmt.Println("MQ is shutting down due to signal:", sig.String())
time.Sleep(time.Second)
fmt.Println("MQ is shut down smoothly")
}
func signalHandlerForMain(sig os.Signal) {
fmt.Println("MainProcess is shutting down due to signal:", sig.String())
}
func main() {
fmt.Println("Process start, pid:", os.Getpid())
gproc.AddSigHandlerShutdown(
signalHandlerForMQ,
signalHandlerForMain,
)
gproc.Listen()
}
go run能正确运行
gf run不能正确运行
Additional
No response
The text was updated successfully, but these errors were encountered:
Description
go run能正确运行
gf run不能正确运行
Additional
No response
The text was updated successfully, but these errors were encountered: