Jianghan 8 месяцев назад
Родитель
Сommit
806dd342d9
3 измененных файлов с 11 добавлено и 7 удалено
  1. 9 5
      data_project/task.go
  2. 1 1
      data_project_wy/go.mod
  3. 1 1
      monitor/main.go

+ 9 - 5
data_project/task.go

@@ -118,10 +118,11 @@ func NewPT() *ProjectTask {
 
 		//saveSign:   make(chan bool, 1),
 		//updateSign: make(chan bool, 1),
-		coll:       ProjectColl,
-		validTime:  int64(util.IntAllDef(config.Conf.Serve.ValidDays, 150)) * 86400,
-		statusTime: int64(util.IntAllDef(config.Conf.Serve.StatusDays, 15) * 86400),
-		jgTime:     int64(util.IntAllDef(7, 7) * 86400),
+		coll:        ProjectColl,
+		validTime:   int64(util.IntAllDef(config.Conf.Serve.ValidDays, 150)) * 86400,
+		statusTime:  int64(util.IntAllDef(config.Conf.Serve.StatusDays, 15) * 86400),
+		jgTime:      int64(util.IntAllDef(7, 7) * 86400),
+		currentType: "ql",
 	}
 	return p
 }
@@ -170,8 +171,10 @@ func (p *ProjectTask) clearMem() {
 	// 创建项目的时间大于7天
 	//在内存中保留最近6个月的信息
 	//跑全量时每5分钟跑一次,跑增量时400分钟跑一次
-	_ = c.AddFunc("50 0/5 * * * *", func() {
+	_ = c.AddFunc("0 0/1 * * * ?", func() {
+		log.Info("1")
 		if (p.currentType == "ql" && SingleClear == 0) || p.clearContimes >= 80 {
+			log.Info("2")
 			SingleClear = 1
 			//跳过的次数清零
 			p.clearContimes = 0
@@ -180,6 +183,7 @@ func (p *ProjectTask) clearMem() {
 			//defer p.findLock.Unlock()
 			//合并进行的任务都完成
 			p.wg.Wait()
+			log.Info("3")
 			//遍历id
 			//所有内存中的项目信息
 			p.AllIdsMapLock.Lock()

+ 1 - 1
data_project_wy/go.mod

@@ -1,6 +1,6 @@
 module data_project_wy
 
-go 1.21.5
+go 1.23
 
 require (
 	github.com/ClickHouse/clickhouse-go/v2 v2.23.0

+ 1 - 1
monitor/main.go

@@ -95,7 +95,7 @@ func taskProject() {
 func SendMsg(content string) {
 	client := &http.Client{}
 	data := map[string]interface{}{"msgtype": "text", "text": map[string]interface{}{
-		"content": content, "mentioned_mobile_list": []string{"13373929153", "15090279371", "15639297172"},
+		"content": content, "mentioned_mobile_list": []string{"13373929153", "17639376639", "18530014520"},
 	}}
 	bytesData, _ := json.Marshal(data)
 	req, _ := http.NewRequest("POST", WebUrl, bytes.NewReader(bytesData))