test
This commit is contained in:
parent
7b292afb4e
commit
d1dfaa54ea
2
def.go
2
def.go
@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type DataBackup struct {
|
type DataBackup struct {
|
||||||
Messages []*ChatWarsMessage `json:"messages"`
|
Messages []ChatWarsMessage `json:"messages"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MQKeepAlive struct {
|
type MQKeepAlive struct {
|
||||||
|
4
msg.go
4
msg.go
@ -275,13 +275,13 @@ func parseSubTypeMessagePillageInc(m *ChatWarsMessage, r *regexp.Regexp) (*ChatW
|
|||||||
|
|
||||||
func zipMessages() ([]byte, error) {
|
func zipMessages() ([]byte, error) {
|
||||||
bkp := DataBackup{}
|
bkp := DataBackup{}
|
||||||
msgs := new([]*ChatWarsMessage)
|
msgs := new([]ChatWarsMessage)
|
||||||
ids := getSQLListID64(`SELECT om.obj_id id FROM obj_msg om;`)
|
ids := getSQLListID64(`SELECT om.obj_id id FROM obj_msg om;`)
|
||||||
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 {
|
||||||
append(*msgs, m)
|
append(*msgs, *m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bkp.Messages = *msgs
|
bkp.Messages = *msgs
|
||||||
|
Loading…
Reference in New Issue
Block a user