This commit is contained in:
shoopea 2019-06-09 00:06:43 +08:00
parent 515d5518e9
commit d3e5166102

7
msg.go
View File

@ -278,12 +278,19 @@ func zipMessages() ([]byte, error) {
s := new([]ChatWarsMessage)
msgs := *s
ids := getSQLListID64(`SELECT om.obj_id id FROM obj_msg om;`)
fmt.Printf("zipMessages : Retrieved %d message ids.\n", len(ids))
i := 0
for _, id := range ids {
m, err := getMsg(id)
logOnError(err, "zipMessages : getMsg")
if err == nil {
msgs = append(msgs, *m)
}
i = i + 1
if i%10000 == 0 {
fmt.Printf("zipMessages : Exported %d messages.\n", i)
}
}
bkp.Messages = msgs
b, err := json.Marshal(bkp)