|
@@ -8,6 +8,7 @@ import ( |
|
@@ -8,6 +8,7 @@ import ( |
8
|
"github.com/beego/beego/v2/server/web"
|
8
|
"github.com/beego/beego/v2/server/web"
|
9
|
serviceTask "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/node_task"
|
9
|
serviceTask "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/node_task"
|
10
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/notify"
|
10
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/notify"
|
|
|
11
|
+ serviceSummary "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/service"
|
11
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
|
12
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
|
12
|
_ "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego"
|
13
|
_ "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego"
|
13
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/consumer"
|
14
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/consumer"
|
|
@@ -16,6 +17,7 @@ import ( |
|
@@ -16,6 +17,7 @@ import ( |
16
|
func main() {
|
17
|
func main() {
|
17
|
startNodeTask()
|
18
|
startNodeTask()
|
18
|
startSummaryEvaluation()
|
19
|
startSummaryEvaluation()
|
|
|
20
|
+ go notify.RunTaskSmsNotify()
|
19
|
go consumer.Run()
|
21
|
go consumer.Run()
|
20
|
web.Run()
|
22
|
web.Run()
|
21
|
}
|
23
|
}
|
|
@@ -44,5 +46,20 @@ func startNodeTask() { |
|
@@ -44,5 +46,20 @@ func startNodeTask() { |
44
|
|
46
|
|
45
|
// 定时任务-间隔检查时间,发送周期评估
|
47
|
// 定时任务-间隔检查时间,发送周期评估
|
46
|
func startSummaryEvaluation() {
|
48
|
func startSummaryEvaluation() {
|
47
|
- go notify.RunTaskSmsNotify()
|
49
|
+ go func() {
|
|
|
50
|
+ var duration time.Duration
|
|
|
51
|
+ if constant.Env == "prd" {
|
|
|
52
|
+ duration = time.Minute * 5
|
|
|
53
|
+ } else {
|
|
|
54
|
+ duration = time.Minute * 1
|
|
|
55
|
+ }
|
|
|
56
|
+ timer := time.NewTimer(duration)
|
|
|
57
|
+ for {
|
|
|
58
|
+ <-timer.C
|
|
|
59
|
+ if err := serviceSummary.TaskSendSummaryEvaluation(); err != nil {
|
|
|
60
|
+ log.Logger.Error(err.Error())
|
|
|
61
|
+ }
|
|
|
62
|
+ timer.Reset(duration) // 重置定时
|
|
|
63
|
+ }
|
|
|
64
|
+ }()
|
48
|
} |
65
|
} |