test stash

This commit is contained in:
shoopea 2020-06-29 10:28:03 +02:00
parent 581f024bc6
commit 5dbfacb1f3

13
job.go
View File

@ -2102,6 +2102,7 @@ func jobGetStash(j Job) {
j.Trigger = 0
} else if rule.MsgTypeID64 == cacheObjSubType[`msg_busy`] {
p.CleanupMsg = append(p.CleanupMsg, *m)
j.Trigger = 0
}
}
}
@ -2120,13 +2121,14 @@ func jobGetStash(j Job) {
userID64 = clt.TGUserID64
busyUntil = clt.CWBusyUntil
}
clt.Mux.Unlock()
}
}
setJobCallback(j.ID64, userID64, cacheObjSubType[`msg_exchange_req`])
setJobCallback(j.ID64, userID64, cacheObjSubType[`msg_exchange_ack`])
setJobCallback(j.ID64, userID64, cacheObjSubType[`msg_busy`])
rescheduleJob(j.ID64, 0, time.Unix(maxUnixTimestamp, 0).UTC())
clientSendCWMsgDelay(userID64, "⚖Exchange", time.Now().UTC().Add(-2*time.Second).Sub(busyUntil))
clientSendCWMsgDelay(userID64, "⚖Exchange", busyUntil.Add(2*time.Second).Sub(time.Now().UTC()))
}
if len(p.ClientID64) == 0 && j.Trigger == 0 {
@ -2135,6 +2137,15 @@ func jobGetStash(j Job) {
}
}
c := TGCommand{
Type: commandReplyMsg,
Text: "Done.",
FromMsgID64: p.MsgID64,
FromChatID64: p.ChatID64,
ParseMode: cmdParseModeHTML,
}
TGCmdQueue <- c
err = setJobDone(j.ID64)
logOnError(err, "jobGetStash : setJobDone")