From: qydysky Date: Wed, 19 Mar 2025 12:03:27 +0000 (+0800) Subject: 1 X-Git-Tag: v0.1.20250319120507~1 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=80a16ce3df349963b3d233f02b9e802871af81b2;p=front%2F.git 1 --- diff --git a/config.go b/config.go index 6170e0c..99e51dc 100755 --- a/config.go +++ b/config.go @@ -122,7 +122,7 @@ func (t *Config) startServer(ctx context.Context, logger Logger, conf *http.Serv var fd uintptr = 0 if t.FdPath != "" { - f := pfile.New(t.FdPath, 0, false) + f := pfile.New(t.FdPath, 0, true) if f.IsExist() { if data, e := f.ReadAll(100, 100); errors.Is(e, io.EOF) { if tmp, e := strconv.Atoi(string(data)); e == nil { @@ -137,6 +137,11 @@ func (t *Config) startServer(ctx context.Context, logger Logger, conf *http.Serv syncWeb, err := pweb.NewSyncMapNoPanic(conf, fd, &t.routeP, matchfunc) if err == nil { logger.Info(`I:`, fmt.Sprintf("Running. Fd:%v", syncWeb.FD)) + f := pfile.New(t.FdPath, 0, true) + if f.IsExist() { + f.Delete() + } + f.Write([]byte(strconv.Itoa(int(syncWeb.FD))), false) shutdown = syncWeb.Shutdown return } else {