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
objSubTypeJobGStock = 605
objSubTypeJobRescanMsg = 606
objSubTypeJobSetJobDone = 607
objSubTypeJobRescanMsgChild = 607
objSubTypeJobSetJobDone = 608
objSubTypeItemResource = 701
objSubTypeItemAlch = 702
objSubTypeItemMisc = 703

18
job.go
View File

@ -34,15 +34,17 @@ func jobRescan(j Job) {
logOnError(err, "jobRescan : createJob(objSubTypeJobRescanMsg)")
}
p := JobPayloadSetDone{
JobID64: j.ID64,
MsgID64: r.MsgID64,
ChatID64: r.ChatID64,
Text: fmt.Sprintf("%d messages processed.", len(ids)),
if j.JobTypeID == objSubTypeJobRescanMsg {
p := JobPayloadSetDone{
JobID64: j.ID64,
MsgID64: r.MsgID64,
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 {
SQLMsgIdentifyQueue <- ids[0]
err = setJobDone(j.ID64)

View File

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