1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-06 20:13:50 +08:00

Update http.go

This commit is contained in:
Ink33 2020-11-17 13:58:23 +08:00
parent beb1a2883a
commit da2e34aaa5

View File

@ -10,7 +10,6 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
"unsafe"
"github.com/guonaihong/gout/dataflow" "github.com/guonaihong/gout/dataflow"
@ -349,8 +348,7 @@ func SetRestart(s *httpServer, c *gin.Context) {
delay, _ := strconv.ParseInt(getParam(c, "delay"), 10, 64) delay, _ := strconv.ParseInt(getParam(c, "delay"), 10, 64)
c.JSON(200, coolq.MSG{"data": nil, "retcode": 0, "status": "async"}) c.JSON(200, coolq.MSG{"data": nil, "retcode": 0, "status": "async"})
go func(delay int64) { go func(delay int64) {
var del *time.Duration = (*time.Duration)(unsafe.Pointer(&delay)) time.Sleep(time.Duration(delay) * time.Millisecond)
time.Sleep(*del * time.Millisecond)
Restart <- struct{}{} Restart <- struct{}{}
}(delay) }(delay)