test
This commit is contained in:
parent
515d5518e9
commit
d3e5166102
7
msg.go
7
msg.go
@ -278,12 +278,19 @@ func zipMessages() ([]byte, error) {
|
|||||||
s := new([]ChatWarsMessage)
|
s := new([]ChatWarsMessage)
|
||||||
msgs := *s
|
msgs := *s
|
||||||
ids := getSQLListID64(`SELECT om.obj_id id FROM obj_msg om;`)
|
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 {
|
for _, id := range ids {
|
||||||
m, err := getMsg(id)
|
m, err := getMsg(id)
|
||||||
logOnError(err, "zipMessages : getMsg")
|
logOnError(err, "zipMessages : getMsg")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
msgs = append(msgs, *m)
|
msgs = append(msgs, *m)
|
||||||
}
|
}
|
||||||
|
i = i + 1
|
||||||
|
if i%10000 == 0 {
|
||||||
|
fmt.Printf("zipMessages : Exported %d messages.\n", i)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
bkp.Messages = msgs
|
bkp.Messages = msgs
|
||||||
b, err := json.Marshal(bkp)
|
b, err := json.Marshal(bkp)
|
||||||
|
Loading…
Reference in New Issue
Block a user