Browse Source

存量合并

zhangjinkun 6 years ago
parent
commit
49824b779b
2 changed files with 5 additions and 3 deletions
  1. 1 0
      udpprojectset/src/config.json
  2. 4 3
      udpprojectset/src/main.go

+ 1 - 0
udpprojectset/src/config.json

@@ -23,6 +23,7 @@
     },
     "taskstock": {
         "open": true,
+        "startdate": "2015-11-01",
         "endate": "2019-06-30"
     },
     "udpport": ":1482",

+ 4 - 3
udpprojectset/src/main.go

@@ -148,8 +148,9 @@ func main() {
 	//clearedis()
 	if taskstock, ok := Sysconfig["taskstock"].(map[string]interface{}); ok { //跑存量数据
 		if b, _ := taskstock["open"].(bool); b {
+			startdate, _ := taskstock["startdate"].(string)
 			endate, _ := taskstock["endate"].(string)
-			taskStock(endate)
+			taskStock(startdate, endate)
 		}
 	}
 	updport := Sysconfig["udpport"].(string)
@@ -288,13 +289,13 @@ func taskInc(mapInfo map[string]interface{}) {
 	}
 }
 
-func taskStock(endDate string) {
+func taskStock(startDate, endDate string) {
 	defer func() {
 		<-SingleThread
 	}()
 	defer util.Catch()
 	publishtimes := []map[string]interface{}{}
-	start, _ := time.ParseInLocation(util.Date_Short_Layout, "2015-11-01", time.Local)
+	start, _ := time.ParseInLocation(util.Date_Short_Layout, startDate, time.Local)
 	end, _ := time.ParseInLocation(util.Date_Short_Layout, endDate, time.Local)
 	for {
 		publishtime := map[string]interface{}{