|
@@ -133,9 +133,14 @@ func CheckLuaMove() {
|
|
|
list, _ := util.MgoEB.Find("luamovelog", query, nil, nil, false, -1, -1)
|
|
|
if len(*list) > 0 {
|
|
|
codes := []string{}
|
|
|
+ arr := [][]map[string]interface{}{}
|
|
|
for _, l := range *list {
|
|
|
code := qu.ObjToString(l["code"])
|
|
|
codes = append(codes, code)
|
|
|
+ update := []map[string]interface{}{}
|
|
|
+ update = append(update, map[string]interface{}{"_id": l["_id"]})
|
|
|
+ update = append(update, map[string]interface{}{"$set": map[string]interface{}{"ok": true, "updatetime": time.Now().Unix()}})
|
|
|
+ arr = append(arr, update)
|
|
|
}
|
|
|
for i := 1; i <= 3; i++ {
|
|
|
res, err := http.Get(fmt.Sprintf("%s?to=%s&title=%s&body=%s", sp.Config.JkMail["api"], sp.Config.JkMail["to"], "lua-move-fail", strings.Join(codes, ";")))
|
|
@@ -146,6 +151,8 @@ func CheckLuaMove() {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ util.MgoEB.UpdateBulk("luamovelog", arr...)
|
|
|
+ arr = [][]map[string]interface{}{}
|
|
|
}
|
|
|
}
|
|
|
|