From 8d64ae614983601df40751c213a96c3073e66d89 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 27 Jan 2023 15:49:55 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/task/queue.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/kernel/task/queue.go b/kernel/task/queue.go index 20baf72c0..df5536341 100644 --- a/kernel/task/queue.go +++ b/kernel/task/queue.go @@ -97,21 +97,23 @@ func StatusJob() { tasks := taskQueue data := map[string]interface{}{} var items []map[string]interface{} + count := map[string]int{} for _, task := range tasks { - if OCRImage == task.Action || DatabaseIndexEmbedBlock == task.Action { - continue - } - actionLangs := util.TaskActionLangs[util.Lang] action := task.Action + if c := count[action]; 3 < c { + logging.LogWarnf("too many tasks [%s], ignore show its status", action) + continue + } + count[action]++ + if nil != actionLangs { if label := actionLangs[task.Action]; nil != label { action = label.(string) } } - item := map[string]interface{}{ - "action": action, - } + + item := map[string]interface{}{"action": action} items = append(items, item) } if 1 > len(items) {