fix unique

This commit is contained in:
shoopea 2020-01-21 15:41:36 +08:00
parent 1c28877a71
commit 9b5fac7dde

43
job.go
View File

@ -1530,30 +1530,31 @@ func jobGWithdraw(j Job) {
b2, _ := json.Marshal(p2) b2, _ := json.Marshal(p2)
createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, 0, time.Now().UTC(), b2) createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, 0, time.Now().UTC(), b2)
for k, req := range p.Items { if isUnique {
if req.Inspect { for k, req := range p.Items {
p2 = JobPayloadMsgDel{ if req.Inspect {
MsgTypeID64: cacheObjSubType[`msg_g_inspect_req`], p2 = JobPayloadMsgDel{
Delay: (10 * time.Second), MsgTypeID64: cacheObjSubType[`msg_g_inspect_req`],
ObjMsgID64: 0, Delay: (10 * time.Second),
ObjMsgID64: 0,
}
b2, _ = json.Marshal(p2)
createJobCallback(cacheObjSubType[`job_msg_del`], j.UserID64, p2.MsgTypeID64, b2, time.Minute)
p.Inspecting = req.Code
b, _ := json.Marshal(p)
id, err := createJob(cacheObjSubType[`job_gwithdraw`], objJobPriority, j.UserID64, 0, time.Unix(maxUnixTimestamp, 0).UTC(), b)
logOnError(err, "jobGWithdraw : createJob")
setJobCallback(id, int64(bot.Me.ID), cacheObjSubType[`msg_invalid_action`])
setJobCallback(id, int64(bot.Me.ID), cacheObjSubType[`msg_inspect_ack`])
clientSendCWMsg(j.UserID64, fmt.Sprintf("/g_inspect_%s", p.Inspecting))
err = setJobDone(j.ID64)
logOnError(err, "jobGWithdraw : setJobDone")
return
} }
b2, _ = json.Marshal(p2)
createJobCallback(cacheObjSubType[`job_msg_del`], j.UserID64, p2.MsgTypeID64, b2, time.Minute)
p.Inspecting = req.Code
b, _ := json.Marshal(p)
id, err := createJob(cacheObjSubType[`job_gwithdraw`], objJobPriority, j.UserID64, 0, time.Unix(maxUnixTimestamp, 0).UTC(), b)
logOnError(err, "jobGWithdraw : createJob")
setJobCallback(id, int64(bot.Me.ID), cacheObjSubType[`msg_invalid_action`])
setJobCallback(id, int64(bot.Me.ID), cacheObjSubType[`msg_inspect_ack`])
clientSendCWMsg(j.UserID64, fmt.Sprintf("/g_inspect_%s", p.Inspecting))
err = setJobDone(j.ID64)
logOnError(err, "jobGWithdraw : setJobDone")
return
} }
} }
} }
if id == cacheObjSubType[`msg_msg_job_gwithdraw_ack`] { if id == cacheObjSubType[`msg_msg_job_gwithdraw_ack`] {