test
This commit is contained in:
parent
50942892bc
commit
96bf2b8de7
5
def.go
5
def.go
@ -215,13 +215,14 @@ const (
|
|||||||
MQCWMsgQueueSize = 100
|
MQCWMsgQueueSize = 100
|
||||||
SQLCWMsgWorkers = 6
|
SQLCWMsgWorkers = 6
|
||||||
SQLIdentifyMsgWorkers = 6
|
SQLIdentifyMsgWorkers = 6
|
||||||
SQLMsgIdentifyQueueSize = 1000
|
SQLMsgIdentifyQueueSize = 100
|
||||||
|
SQLMsgRescanJobSize = 25
|
||||||
SQLJobWorkers = 12
|
SQLJobWorkers = 12
|
||||||
TGCmdWorkers = 3
|
TGCmdWorkers = 3
|
||||||
TGCmdQueueSize = 100
|
TGCmdQueueSize = 100
|
||||||
MQTGCmdWorkers = 3
|
MQTGCmdWorkers = 3
|
||||||
MQTGCmdQueueSize = 100
|
MQTGCmdQueueSize = 100
|
||||||
SQLJobSliceSize = 250
|
SQLJobSliceSize = 25
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
52
job.go
52
job.go
@ -18,9 +18,14 @@ func jobRescan(j Job) {
|
|||||||
ids := getSQLListID64(r.Query)
|
ids := getSQLListID64(r.Query)
|
||||||
|
|
||||||
if len(ids) > 1 {
|
if len(ids) > 1 {
|
||||||
for _, id := range ids {
|
for i := 1; i <= (len(ids)/SQLMsgRescanJobSize)+1; i++ {
|
||||||
|
var s string
|
||||||
|
for _, id := range ids[((i - 1) * SQLMsgRescanJobSize):(i*SQLMsgRescanJobSize - 1)] {
|
||||||
|
s = s + fmp.Sprintf("SELECT %d id FROM DUAL UNION\n", id)
|
||||||
|
}
|
||||||
|
s = s + fmp.Sprintf("SELECT 0 id FROM DUAL WHERE 1 = 2;", id)
|
||||||
p := JobPayloadRescanMsg{
|
p := JobPayloadRescanMsg{
|
||||||
Query: fmt.Sprintf("SELECT %d id FROM DUAL;", id),
|
Query: s,
|
||||||
MsgID64: 0,
|
MsgID64: 0,
|
||||||
ChatID64: 0,
|
ChatID64: 0,
|
||||||
}
|
}
|
||||||
@ -28,6 +33,7 @@ func jobRescan(j Job) {
|
|||||||
err := createJob(objSubTypeJobRescanMsg, objJobPriorityRescanChildMsg, j.UserID64, time.Now(), b)
|
err := createJob(objSubTypeJobRescanMsg, objJobPriorityRescanChildMsg, j.UserID64, time.Now(), b)
|
||||||
logOnError(err, "jobRescan : createJob(objSubTypeJobRescanMsg)")
|
logOnError(err, "jobRescan : createJob(objSubTypeJobRescanMsg)")
|
||||||
}
|
}
|
||||||
|
|
||||||
p := JobPayloadSetDone{
|
p := JobPayloadSetDone{
|
||||||
JobID64: j.ID64,
|
JobID64: j.ID64,
|
||||||
MsgID64: r.MsgID64,
|
MsgID64: r.MsgID64,
|
||||||
@ -94,31 +100,31 @@ func jobSetDone(j Job) {
|
|||||||
|
|
||||||
func jobPillage(j Job) {
|
func jobPillage(j Job) {
|
||||||
/*
|
/*
|
||||||
var r JobPayloadPillage
|
var r JobPayloadPillage
|
||||||
|
|
||||||
err := setJobStart(j.ID64)
|
err := setJobStart(j.ID64)
|
||||||
logOnError(err, "jobPillage : setJobStart")
|
logOnError(err, "jobPillage : setJobStart")
|
||||||
|
|
||||||
err = json.Unmarshal(j.Payload, &r)
|
err = json.Unmarshal(j.Payload, &r)
|
||||||
logOnError(err, "jobPillage : Unmarshal payload")
|
logOnError(err, "jobPillage : Unmarshal payload")
|
||||||
|
|
||||||
ids := getSQLListID64(` select og.id
|
ids := getSQLListID64(` select og.id
|
||||||
from obj og
|
from obj og
|
||||||
,obj_msg omg
|
,obj_msg omg
|
||||||
,obj op
|
,obj op
|
||||||
,obj_msg omp
|
,obj_msg omp
|
||||||
,obj_job oj
|
,obj_job oj
|
||||||
where omg.obj_id = og.id
|
where omg.obj_id = og.id
|
||||||
and og.obj_sub_type_id = ` + strconv.Itoa(objSubTypeMessageGo) `
|
and og.obj_sub_type_id = ` + strconv.Itoa(objSubTypeMessageGo) `
|
||||||
and omg.user_id = oj.user_id
|
and omg.user_id = oj.user_id
|
||||||
and omg.sender_user_id = oj.user_id
|
and omg.sender_user_id = oj.user_id
|
||||||
and oj.obj_id = ` + strconv.Itoa(j.ID64) `
|
and oj.obj_id = ` + strconv.Itoa(j.ID64) `
|
||||||
and omp.obj_id = op.id
|
and omp.obj_id = op.id
|
||||||
and op.id = ` + strconv.Itoa(r.ObjID64) `
|
and op.id = ` + strconv.Itoa(r.ObjID64) `
|
||||||
and omg.date between omp.date and addtime(omp.date, '0 0:3:0.000000');`
|
and omg.date between omp.date and addtime(omp.date, '0 0:3:0.000000');`
|
||||||
|
|
||||||
err = setJobStatus(j.ID64, objJobStatusPillageGo, time.Now().Add(5 * time.second))
|
err = setJobStatus(j.ID64, objJobStatusPillageGo, time.Now().Add(5 * time.second))
|
||||||
logOnError(err, "jobPillage : setJobDone")
|
logOnError(err, "jobPillage : setJobDone")
|
||||||
*/
|
*/
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user