3136352472 5 years ago
parent
commit
ee783db793
  1. 6
      pool/pool.go

6
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 / 5)
time.Sleep(time.Second * 2)
} }
} }
go preparePoolTask() go preparePoolTask()
@ -78,13 +78,13 @@ func NewJsRuntimePool(mainScript string, useFileName string, staticPath string,
useSrcTask = func() { useSrcTask = func() {
defer func() { defer func() {
recover() recover()
time.Sleep(time.Second)
time.Sleep(time.Second * 3)
useSrcTask() useSrcTask()
}() }()
for { for {
raw, _ := ioutil.ReadFile(useFileName) raw, _ := ioutil.ReadFile(useFileName)
useSrc = string(raw) useSrc = string(raw)
time.Sleep(time.Second)
time.Sleep(time.Second * 3)
} }
} }
go useSrcTask() go useSrcTask()

Loading…
Cancel
Save