test
This commit is contained in:
parent
8c80e1dc87
commit
3e0370631e
6
def.go
6
def.go
@ -193,8 +193,7 @@ const (
|
|||||||
objSubTypeJobWithdrawal = 604
|
objSubTypeJobWithdrawal = 604
|
||||||
objSubTypeJobGStock = 605
|
objSubTypeJobGStock = 605
|
||||||
objSubTypeJobRescanMsg = 606
|
objSubTypeJobRescanMsg = 606
|
||||||
objSubTypeJobRescanMsgChild = 607
|
objSubTypeJobSetJobDone = 607
|
||||||
objSubTypeJobSetJobDone = 608
|
|
||||||
objSubTypeItemResource = 701
|
objSubTypeItemResource = 701
|
||||||
objSubTypeItemAlch = 702
|
objSubTypeItemAlch = 702
|
||||||
objSubTypeItemMisc = 703
|
objSubTypeItemMisc = 703
|
||||||
@ -209,8 +208,7 @@ const (
|
|||||||
|
|
||||||
objJobPriority = 1
|
objJobPriority = 1
|
||||||
objJobPriorityRescanMsg = 2
|
objJobPriorityRescanMsg = 2
|
||||||
objJobPriorityRescanChildMsg = 3
|
objJobPriorityRescanAllMsg = 3
|
||||||
objJobPriorityRescanAllMsg = 4
|
|
||||||
|
|
||||||
MQGetMsgWorkers = 12
|
MQGetMsgWorkers = 12
|
||||||
MQCWMsgQueueSize = 100
|
MQCWMsgQueueSize = 100
|
||||||
|
20
job.go
20
job.go
@ -18,23 +18,9 @@ func jobRescan(j Job) {
|
|||||||
ids := getSQLListID64(r.Query)
|
ids := getSQLListID64(r.Query)
|
||||||
|
|
||||||
if len(ids) > 1 {
|
if len(ids) > 1 {
|
||||||
for i := 1; i <= (len(ids)/SQLMsgRescanJobSize)+1; i++ {
|
for _, id := range ids {
|
||||||
var s string
|
SQLMsgIdentifyQueue <- id
|
||||||
for _, id := range ids[((i - 1) * SQLMsgRescanJobSize) : Min((i*SQLMsgRescanJobSize), len(ids))-1] {
|
|
||||||
s = s + fmt.Sprintf("SELECT %d id FROM DUAL UNION\n", id)
|
|
||||||
}
|
}
|
||||||
s = s + `SELECT 0 id FROM DUAL WHERE 1 = 2;`
|
|
||||||
p := JobPayloadRescanMsg{
|
|
||||||
Query: s,
|
|
||||||
MsgID64: 0,
|
|
||||||
ChatID64: 0,
|
|
||||||
}
|
|
||||||
b, _ := json.Marshal(p)
|
|
||||||
err := createJob(objSubTypeJobRescanMsg, objJobPriorityRescanChildMsg, j.UserID64, time.Now(), b)
|
|
||||||
logOnError(err, "jobRescan : createJob(objSubTypeJobRescanMsg)")
|
|
||||||
}
|
|
||||||
|
|
||||||
if j.JobTypeID == objSubTypeJobRescanMsg {
|
|
||||||
p := JobPayloadSetDone{
|
p := JobPayloadSetDone{
|
||||||
JobID64: j.ID64,
|
JobID64: j.ID64,
|
||||||
MsgID64: r.MsgID64,
|
MsgID64: r.MsgID64,
|
||||||
@ -44,7 +30,7 @@ func jobRescan(j Job) {
|
|||||||
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)
|
||||||
logOnError(err, "jobRescan : createJob(objSubTypeJobSetJobDone)")
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user