This commit is contained in:
shoopea 2019-05-19 11:02:43 +08:00
parent d3e09278a7
commit bf42f210db
3 changed files with 14 additions and 9 deletions

3
def.go
View File

@ -193,7 +193,8 @@ const (
objSubTypeJobWithdrawal = 604 objSubTypeJobWithdrawal = 604
objSubTypeJobGStock = 605 objSubTypeJobGStock = 605
objSubTypeJobRescanMsg = 606 objSubTypeJobRescanMsg = 606
objSubTypeJobSetJobDone = 607 objSubTypeJobRescanMsgChild = 607
objSubTypeJobSetJobDone = 608
objSubTypeItemResource = 701 objSubTypeItemResource = 701
objSubTypeItemAlch = 702 objSubTypeItemAlch = 702
objSubTypeItemMisc = 703 objSubTypeItemMisc = 703

18
job.go
View File

@ -34,15 +34,17 @@ func jobRescan(j Job) {
logOnError(err, "jobRescan : createJob(objSubTypeJobRescanMsg)") logOnError(err, "jobRescan : createJob(objSubTypeJobRescanMsg)")
} }
p := JobPayloadSetDone{ if j.JobTypeID == objSubTypeJobRescanMsg {
JobID64: j.ID64, p := JobPayloadSetDone{
MsgID64: r.MsgID64, JobID64: j.ID64,
ChatID64: r.ChatID64, MsgID64: r.MsgID64,
Text: fmt.Sprintf("%d messages processed.", len(ids)), ChatID64: r.ChatID64,
Text: fmt.Sprintf("%d messages processed.", len(ids)),
}
b, _ := json.Marshal(p)
err := createJob(objSubTypeJobSetJobDone, objJobPriorityRescanAllMsg, j.UserID64, time.Now(), b)
logOnError(err, "jobRescan : createJob(objSubTypeJobSetJobDone)")
} }
b, _ := json.Marshal(p)
err := createJob(objSubTypeJobSetJobDone, objJobPriority, j.UserID64, time.Now(), b)
logOnError(err, "jobRescan : createJob(objSubTypeJobSetJobDone)")
} else if len(ids) == 1 { } else if len(ids) == 1 {
SQLMsgIdentifyQueue <- ids[0] SQLMsgIdentifyQueue <- ids[0]
err = setJobDone(j.ID64) err = setJobDone(j.ID64)

View File

@ -207,6 +207,8 @@ func SQLJobWorker(id int) {
switch j.JobTypeID { switch j.JobTypeID {
case objSubTypeJobRescanMsg: case objSubTypeJobRescanMsg:
jobRescan(j) jobRescan(j)
case objSubTypeJobRescanMsgChild:
jobRescan(j)
case objSubTypeJobSetJobDone: case objSubTypeJobSetJobDone:
jobSetDone(j) jobSetDone(j)
case objSubTypeJobPillage: case objSubTypeJobPillage: