fix append stocks

This commit is contained in:
shoopea 2019-12-13 19:26:11 +08:00
parent bb05526a51
commit 7c34ee16c5

20
job.go
View File

@ -718,7 +718,9 @@ func jobGStock(j Job) {
rule, err := getMsgParsingRule(msg)
logOnError(err, "jobGStock : getMsgParsingRule")
cwm, err := parseSubTypeMessageGStockAnyAck(msg, rule.re)
p.Stock = append(p.Stock, cwm.Stock)
for _, v := range cwm.Stock {
p.Stock = append(p.Stock, v)
}
p.Progress = 2
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, c.TGUserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
@ -730,7 +732,9 @@ func jobGStock(j Job) {
rule, err := getMsgParsingRule(msg)
logOnError(err, "jobGStock : getMsgParsingRule")
cwm, err := parseSubTypeMessageGStockAnyAck(msg, rule.re)
p.Stock = append(p.Stock, cwm.Stock)
for _, v := range cwm.Stock {
p.Stock = append(p.Stock, v)
}
p.Progress = 3
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, c.TGUserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
@ -742,7 +746,9 @@ func jobGStock(j Job) {
rule, err := getMsgParsingRule(msg)
logOnError(err, "jobGStock : getMsgParsingRule")
cwm, err := parseSubTypeMessageGStockAnyAck(msg, rule.re)
p.Stock = append(p.Stock, cwm.Stock)
for _, v := range cwm.Stock {
p.Stock = append(p.Stock, v)
}
p.Progress = 4
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, c.TGUserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
@ -754,7 +760,9 @@ func jobGStock(j Job) {
rule, err := getMsgParsingRule(msg)
logOnError(err, "jobGStock : getMsgParsingRule")
cwm, err := parseSubTypeMessageGStockAnyAck(msg, rule.re)
p.Stock = append(p.Stock, cwm.Stock)
for _, v := range cwm.Stock {
p.Stock = append(p.Stock, v)
}
p.Progress = 5
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, c.TGUserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)
@ -766,7 +774,9 @@ func jobGStock(j Job) {
rule, err := getMsgParsingRule(msg)
logOnError(err, "jobGStock : getMsgParsingRule")
cwm, err := parseSubTypeMessageGStockAnyAck(msg, rule.re)
p.Stock = append(p.Stock, cwm.Stock)
for _, v := range cwm.Stock {
p.Stock = append(p.Stock, v)
}
p.Progress = 6
b, _ := json.Marshal(&p)
err = createJobCallback(objSubTypeJobGStock, c.TGUserID64, objSubTypeMessageGStockAnyAck, b, 1*time.Minute)