fix job slaves shop

This commit is contained in:
shoopea 2020-02-11 10:15:44 +08:00
parent c3e7844c81
commit d25d00aee9

13
job.go
View File

@ -2327,6 +2327,14 @@ 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)
muxObjJob.Unlock()
c := TGCommand{
Type: commandReplyMsg,
Text: fmt.Sprintf("Unknown shop /ws_%s\n", p.Shops[0]),
@ -2336,7 +2344,10 @@ func jobShopsSlave(j Job) {
}
TGCmdQueue <- c
fallthrough
p.Shops = append(p.Shops[:0], p.Shops[1:]...)
err = setJobPayloadJSON(j.ID64, p)
logOnError(err, "jobShopsSlave : setJobPayloadJSON")
case cacheObjSubType[`msg_shop_main_ack`]:
muxObjJob.Lock()
b2 := getJobPayloadUnsafe(p.JobCallbackID64)