|
@@ -89,7 +89,7 @@ func updateStd() {
|
|
|
// 创建数据库操作对象
|
|
|
badgerDB := &bdb{db}
|
|
|
var id int64
|
|
|
-
|
|
|
+ // 获取 autoid
|
|
|
auotidOld := badgerDB.Get("autoid")
|
|
|
if auotidOld == "" {
|
|
|
id = int64(GF.Env.Autoid) //起始 autoid
|
|
@@ -99,14 +99,23 @@ func updateStd() {
|
|
|
id = int64(aotoid)
|
|
|
}
|
|
|
|
|
|
+ log.Println("autoid:", id)
|
|
|
+ if id == 0 {
|
|
|
+ log.Fatalln("autoid 为 0,请检查配置")
|
|
|
+ }
|
|
|
+ //获取 seo_id
|
|
|
seoIdOld := badgerDB.Get("seoid")
|
|
|
if seoIdOld == "" {
|
|
|
startSeoId = int64(GF.Env.Seoid) //起始 nseo_id
|
|
|
- badgerDB.Set("autoid", strconv.Itoa(GF.Env.Seoid))
|
|
|
+ badgerDB.Set("seoid", strconv.Itoa(GF.Env.Seoid))
|
|
|
} else {
|
|
|
seoid, _ := strconv.Atoi(seoIdOld)
|
|
|
startSeoId = int64(seoid)
|
|
|
}
|
|
|
+ log.Println("seoid", startSeoId)
|
|
|
+ if startSeoId == 0 {
|
|
|
+ log.Fatalln("seoid 为 0,请检查配置")
|
|
|
+ }
|
|
|
|
|
|
rand.Seed(time.Now().UnixNano())
|
|
|
|
|
@@ -156,7 +165,10 @@ func updateStd() {
|
|
|
"_id": tmp["_id"],
|
|
|
}
|
|
|
|
|
|
- MongoTool.Update("qyxy_std", where, update, true, false)
|
|
|
+ res := MongoTool.Update("qyxy_std", where, update, true, false)
|
|
|
+ if !res {
|
|
|
+ log.Println(tmp["_id"], "数据更新失败,nseo_id", nseo_id)
|
|
|
+ }
|
|
|
|
|
|
if count%10000 == 0 {
|
|
|
log.Println("current,autoid,startSeoId,nseo_id", count, id, startSeoId, nseo_id)
|
|
@@ -173,6 +185,6 @@ func updateStd() {
|
|
|
badgerDB.Set("autoid", strconv.Itoa(int(id)))
|
|
|
badgerDB.Set("seoid", strconv.Itoa(int(startSeoId)))
|
|
|
|
|
|
- log.Println("over ----;", "seo_id:", startSeoId)
|
|
|
+ log.Println("over ----;", "autoid", id, "seoid:", startSeoId)
|
|
|
|
|
|
}
|