mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 12:17:53 +08:00
fix issue in reload feature in ghttp.Server
This commit is contained in:
parent
efc0501548
commit
2f44721086
@ -7,6 +7,7 @@ import (
|
||||
func main() {
|
||||
s := g.Server()
|
||||
s.EnableAdmin()
|
||||
|
||||
//s.BindHookHandler("/admin/*any", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
|
||||
// if !r.BasicAuth("admin", "123", "") {
|
||||
// r.Exit()
|
||||
|
@ -183,6 +183,7 @@ func init() {
|
||||
// which is false in default.
|
||||
//
|
||||
// Note that this feature switch is not for single server instance but for whole process.
|
||||
// Deprecated, use configuration of ghttp.Server for controlling this feature.
|
||||
func SetGraceful(enabled bool) {
|
||||
gracefulEnabled = enabled
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/text/gstr"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
@ -112,7 +113,7 @@ func forkReloadProcess(newExeFilePath ...string) error {
|
||||
for fdk, fdv := range m {
|
||||
if len(fdv) > 0 {
|
||||
s := ""
|
||||
for _, item := range strings.Split(fdv, ",") {
|
||||
for _, item := range gstr.SplitAndTrim(fdv, ",") {
|
||||
array := strings.Split(item, "#")
|
||||
fd := uintptr(gconv.Uint(array[1]))
|
||||
if fd > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user