3136352472 5 years ago
parent
commit
276db7e068
  1. 3
      govue/cmd/main.go
  2. 4
      pool/pool.go

3
govue/cmd/main.go

@ -8,7 +8,6 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"log" "log"
"mime" "mime"
"net/http"
"path/filepath" "path/filepath"
) )
@ -92,7 +91,7 @@ func main() {
} }
if extData["cookie"].(map[string]string)["extdatasessionkey"] == "" { if extData["cookie"].(map[string]string)["extdatasessionkey"] == "" {
context.SetCookie("extdatasessionkey", uuid.Must(uuid.NewUUID()).String(), 0, "", context.Request.Host, http.SameSiteLaxMode, false, false)
context.SetCookie("extdatasessionkey", uuid.Must(uuid.NewUUID()).String(), 0, "", context.Request.Host, false, false)
} }
raw, err := gv.LoadStaticResources(context.Request, extData) raw, err := gv.LoadStaticResources(context.Request, extData)

4
pool/pool.go

@ -69,7 +69,7 @@ func NewJsRuntimePool(mainScript string, useFileName string, staticPath string,
}() }()
for { for {
jrp.jsRuntimePool.PreparePool(jrp.ctx) jrp.jsRuntimePool.PreparePool(jrp.ctx)
time.Sleep(time.Second * 2)
time.Sleep(time.Second)
} }
} }
go preparePoolTask() go preparePoolTask()
@ -78,7 +78,7 @@ func NewJsRuntimePool(mainScript string, useFileName string, staticPath string,
useSrcTask = func() { useSrcTask = func() {
defer func() { defer func() {
recover() recover()
time.Sleep(time.Second * 3)
time.Sleep(time.Second)
useSrcTask() useSrcTask()
}() }()
for { for {

Loading…
Cancel
Save