|
|
package main
|
|
|
|
|
|
import (
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/constant"
|
|
|
"time"
|
|
|
|
|
|
"github.com/beego/beego/v2/server/web"
|
...
|
...
|
@@ -27,7 +28,13 @@ func startNodeTask() { |
|
|
go func() {
|
|
|
nodeTaskService := serviceTask.NewNodeTaskService()
|
|
|
for {
|
|
|
timer := time.NewTimer(time.Minute * 5)
|
|
|
var duration time.Duration
|
|
|
if constant.Env == "prd" {
|
|
|
duration = time.Minute * 5
|
|
|
} else {
|
|
|
duration = time.Minute * 1
|
|
|
}
|
|
|
timer := time.NewTimer(duration)
|
|
|
<-timer.C
|
|
|
if err := nodeTaskService.SendEvaluationNode(); err != nil {
|
|
|
log.Logger.Error(err.Error())
|
...
|
...
|
|