This commit is contained in:
shoopea 2019-06-11 14:36:08 +08:00
parent b9f7f66888
commit 2cfa23e7d2

View File

@ -185,14 +185,12 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
cwm.ObjID64 = objId
err = insertMsgAuctionAnnounce(cwm)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : insertMsgAuctionAnnounce")
if cwm.End.Add(1*time.Minute).After(time.Now().UTC()) ||
(cwm.End.Add(1*time.Minute).Before(time.Now().UTC()) && strings.Compare(cwm.Status, `#active`) == 0) {
if cwm.End.After(time.Now().UTC()) || strings.Compare(cwm.Status, `#active`) == 0 {
p := JobPayloadMsgRefresh{
ObjID64: m.ObjID64,
}
log.Printf("SQLIdentifyMsgWorker[%d] : Auction %d ending at %s but it's %s already.\n", id, cwm.LotID, cwm.End.Format(time.RFC3339), time.Now().UTC().Format(time.RFC3339))
b, _ := json.Marshal(&p)
_, err = createJob(objSubTypeJobMsgRefresh, objJobPriority, m.UserID64, cwm.End.Add(1*time.Minute), b)
_, err = createJob(objSubTypeJobMsgRefresh, objJobPriority, m.UserID64, cwm.End.Add(5*time.Minute).UTC(), b)
}
case objSubTypeMessageTimeAck:
_, err := fromChatWarsDate(r.ReplaceAllString(m.Text, "${Day}") + " " + r.ReplaceAllString(m.Text, "${Month}") + " " + r.ReplaceAllString(m.Text, "${Year}") + " " + r.ReplaceAllString(m.Text, "${Hour}") + ":" + r.ReplaceAllString(m.Text, "${Minute}"))