mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
28 lines
616 B
Go
28 lines
616 B
Go
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
|
//
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
// If a copy of the MIT was not distributed with this file,
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
//go:build windows
|
|
// +build windows
|
|
|
|
package ghttp
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
|
|
"github.com/gogf/gf/v2/os/gproc"
|
|
)
|
|
|
|
// handleProcessSignal handles all signals from system in blocking way.
|
|
func handleProcessSignal() {
|
|
var ctx = context.TODO()
|
|
gproc.AddSigHandlerShutdown(func(sig os.Signal) {
|
|
shutdownWebServersGracefully(ctx, sig)
|
|
})
|
|
|
|
gproc.Listen()
|
|
}
|