|
@@ -3,6 +3,13 @@ package main
|
|
import (
|
|
import (
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "project/config"
|
|
|
|
+ "regexp"
|
|
|
|
+ "strings"
|
|
|
|
+ "sync"
|
|
|
|
+ "time"
|
|
|
|
+ "unicode/utf8"
|
|
|
|
+
|
|
"github.com/goinggo/mapstructure"
|
|
"github.com/goinggo/mapstructure"
|
|
"github.com/robfig/cron"
|
|
"github.com/robfig/cron"
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
@@ -12,12 +19,6 @@ import (
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/mongodb"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/mongodb"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/redis"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/redis"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/udp"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/udp"
|
|
- "project/config"
|
|
|
|
- "regexp"
|
|
|
|
- "strings"
|
|
|
|
- "sync"
|
|
|
|
- "time"
|
|
|
|
- "unicode/utf8"
|
|
|
|
)
|
|
)
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -118,10 +119,11 @@ func NewPT() *ProjectTask {
|
|
|
|
|
|
//saveSign: make(chan bool, 1),
|
|
//saveSign: make(chan bool, 1),
|
|
//updateSign: 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
|
|
return p
|
|
}
|
|
}
|
|
@@ -170,8 +172,8 @@ func (p *ProjectTask) clearMem() {
|
|
// 创建项目的时间大于7天
|
|
// 创建项目的时间大于7天
|
|
//在内存中保留最近6个月的信息
|
|
//在内存中保留最近6个月的信息
|
|
//跑全量时每5分钟跑一次,跑增量时400分钟跑一次
|
|
//跑全量时每5分钟跑一次,跑增量时400分钟跑一次
|
|
- _ = c.AddFunc("50 0/5 * * * *", func() {
|
|
|
|
- if (p.currentType == "ql" && SingleClear == 0) || p.clearContimes >= 80 {
|
|
|
|
|
|
+ _ = c.AddFunc("0 */30 * * * ?", func() {
|
|
|
|
+ if (p.currentType == "ql" && SingleClear == 0) || p.clearContimes >= 20 {
|
|
SingleClear = 1
|
|
SingleClear = 1
|
|
//跳过的次数清零
|
|
//跳过的次数清零
|
|
p.clearContimes = 0
|
|
p.clearContimes = 0
|