This commit is contained in:
shoopea 2019-05-19 11:24:45 +08:00
parent bf3c440f13
commit 5ef14e6c05

4
job.go
View File

@ -15,6 +15,8 @@ func jobRescan(j Job) {
err = json.Unmarshal(j.Payload, &r) err = json.Unmarshal(j.Payload, &r)
logOnError(err, "jobRescan : Unmarshal payload") logOnError(err, "jobRescan : Unmarshal payload")
start := time.Now()
ids := getSQLListID64(r.Query) ids := getSQLListID64(r.Query)
if len(ids) > 1 { if len(ids) > 1 {
@ -25,7 +27,7 @@ func jobRescan(j Job) {
JobID64: j.ID64, JobID64: j.ID64,
MsgID64: r.MsgID64, MsgID64: r.MsgID64,
ChatID64: r.ChatID64, ChatID64: r.ChatID64,
Text: fmt.Sprintf("%d messages processed.", len(ids)), Text: fmt.Sprintf("%d messages processed in %s.", len(ids), time.Since(start)),
} }
b, _ := json.Marshal(p) b, _ := json.Marshal(p)
err := createJob(objSubTypeJobSetJobDone, objJobPriorityRescanAllMsg, j.UserID64, time.Now(), b) err := createJob(objSubTypeJobSetJobDone, objJobPriorityRescanAllMsg, j.UserID64, time.Now(), b)