This commit is contained in:
shoopea 2019-05-31 20:30:08 +08:00
parent 06dc7c7662
commit 665f3fff73
4 changed files with 6 additions and 5 deletions

3
def.go
View File

@ -324,7 +324,8 @@ const (
SQLIdentifyMsgWorkers = 6
SQLMsgIdentifyQueueSize = 100
SQLMsgRescanJobSize = 25
SQLJobWorkers = 12
JobWorkers = 12
JobQueueSize = 100
TGCmdWorkers = 3
TGCmdQueueSize = 100
MQTGCmdWorkers = 3

2
job.go
View File

@ -316,7 +316,7 @@ func jobPillage(j Job) {
s := TGCommand{
Type: commandSendMsg,
Text: fmt.Sprintf("No outcome for the pillage yet(%s)", m.Date.Format(time.RFC3339)),
Text: fmt.Sprintf("No outcome for the pillage yet"),
ToUserID64: j.UserID64,
}
TGCmdQueue <- s

View File

@ -139,8 +139,8 @@ func main() {
for w := 1; w <= SQLIdentifyMsgWorkers; w++ {
go SQLIdentifyMsgWorker(w, SQLMsgIdentifyQueue)
}
for w := 1; w <= jobWorkers; w++ {
go jobWorker(w, JobQueue)
for w := 1; w <= JobWorkers; w++ {
go JobWorker(w, JobQueue)
}
for w := 1; w <= TGCmdWorkers; w++ {
go TGCmdWorker(w, b, TGCmdQueue)

View File

@ -297,7 +297,7 @@ func SQLJobWorker() {
log.Printf("SQLJobWorker : Closing.")
}
func jobWorker(id int, jobs <-chan Job) {
func JobWorker(id int, jobs <-chan Job) {
//log.Printf("jobWorker[" + strconv.Itoa(id) + "] : Starting.")
for j := range jobs {
switch j.JobTypeID {