From d25d00aee95bf5e954ebc07119848436296b1c39 Mon Sep 17 00:00:00 2001 From: shoopea Date: Tue, 11 Feb 2020 10:15:44 +0800 Subject: [PATCH] fix job slaves shop --- job.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/job.go b/job.go index a6961b8..16c9a9b 100644 --- a/job.go +++ b/job.go @@ -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)