From da2e34aaa5664486a601f9f50808181b1902f911 Mon Sep 17 00:00:00 2001 From: Ink33 <51873347+Ink-33@users.noreply.github.com> Date: Tue, 17 Nov 2020 13:58:23 +0800 Subject: [PATCH] Update http.go --- server/http.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/http.go b/server/http.go index ac83dd7..f79d443 100644 --- a/server/http.go +++ b/server/http.go @@ -10,7 +10,6 @@ import ( "strconv" "strings" "time" - "unsafe" "github.com/guonaihong/gout/dataflow" @@ -349,8 +348,7 @@ func SetRestart(s *httpServer, c *gin.Context) { delay, _ := strconv.ParseInt(getParam(c, "delay"), 10, 64) c.JSON(200, coolq.MSG{"data": nil, "retcode": 0, "status": "async"}) go func(delay int64) { - var del *time.Duration = (*time.Duration)(unsafe.Pointer(&delay)) - time.Sleep(*del * time.Millisecond) + time.Sleep(time.Duration(delay) * time.Millisecond) Restart <- struct{}{} }(delay)