|
@@ -94,7 +94,7 @@ func (m *MatchJob) LoadIncDatas() (string, *[]map[string]interface{}) {
|
|
"top_category": 1,
|
|
"top_category": 1,
|
|
"approvestatus": 1,
|
|
"approvestatus": 1,
|
|
}).Sort("_id").Iter()
|
|
}).Sort("_id").Iter()
|
|
- index := 0
|
|
|
|
|
|
+ var index int64
|
|
endId := ""
|
|
endId := ""
|
|
for temp := make(map[string]interface{}); it.Next(&temp); {
|
|
for temp := make(map[string]interface{}); it.Next(&temp); {
|
|
endId = BsonIdToSId(temp["_id"])
|
|
endId = BsonIdToSId(temp["_id"])
|
|
@@ -105,6 +105,9 @@ func (m *MatchJob) LoadIncDatas() (string, *[]map[string]interface{}) {
|
|
if index%500 == 0 {
|
|
if index%500 == 0 {
|
|
logger.Info("加载", DbConf.Mongodb.ProjectForecast.Collection, "数据:", index)
|
|
logger.Info("加载", DbConf.Mongodb.ProjectForecast.Collection, "数据:", index)
|
|
}
|
|
}
|
|
|
|
+ if Config.LoadBiddingMaxSize > 0 && index > Config.LoadBiddingMaxSize {
|
|
|
|
+ break
|
|
|
|
+ }
|
|
}
|
|
}
|
|
logger.Info(DbConf.Mongodb.ProjectForecast.Collection, "数据已经加载结束。。。", index)
|
|
logger.Info(DbConf.Mongodb.ProjectForecast.Collection, "数据已经加载结束。。。", index)
|
|
return endId, &res
|
|
return endId, &res
|