fix job slaves shop

This commit is contained in:
shoopea 2020-02-11 10:14:42 +08:00
parent 4aea83ebbe
commit c3e7844c81

17
job.go
View File

@ -2327,15 +2327,6 @@ func jobShopsSlave(j Job) {
rescheduleJob(j.ID64, 0, time.Unix(maxUnixTimestamp, 0).UTC()) // reschedule so that it gets picked up by shop main ack callback
return
case cacheObjSubType[`msg_unknown_action`]:
muxObjJob.Lock()
b2 := getJobPayloadUnsafe(p.JobCallbackID64)
var p2 JobPayloadShops
err = json.Unmarshal(b2, &p2)
p2.Msgs = append(p2.Msgs, *m)
err = setJobPayloadJSONUnsafe(p.JobCallbackID64, p2)
logOnError(err, "jobShopsSlave : setJobPayloadJSONUnsafe")
muxObjJob.Unlock()
c := TGCommand{
Type: commandReplyMsg,
Text: fmt.Sprintf("Unknown shop /ws_%s\n", p.Shops[0]),
@ -2345,14 +2336,8 @@ func jobShopsSlave(j Job) {
}
TGCmdQueue <- c
p.Shops = append(p.Shops[:0], p.Shops[1:]...)
err = setJobPayloadJSON(j.ID64, p)
logOnError(err, "jobShopsSlave : setJobPayloadJSON")
fallthrough
case cacheObjSubType[`msg_shop_main_ack`]:
cwm, err := parseSubTypeMessageShopMainAck(m, rule.re)
logOnError(err, "jobShopsSlave : parseSubTypeMessageShopMainAck")
muxObjJob.Lock()
b2 := getJobPayloadUnsafe(p.JobCallbackID64)
var p2 JobPayloadShops