diff --git a/src/modules/judge/judge/judge.go b/src/modules/judge/judge/judge.go index 00d737b8..422bdd5a 100644 --- a/src/modules/judge/judge/judge.go +++ b/src/modules/judge/judge/judge.go @@ -177,7 +177,13 @@ func judgeItemWithStrategy(stra *model.Stra, historyData []*dataobj.HistoryData, logger.Errorf("wrong step:%+v", firstItem) return } - straParam = append(straParam, stra.AlertDur/int(firstItem.Step)) + + limit := stra.AlertDur / int(firstItem.Step) + if limit <= 0 { + limit = 1 + } + + straParam = append(straParam, limit) switch straFunc { case "happen": diff --git a/src/modules/judge/rpc/push.go b/src/modules/judge/rpc/push.go index dbaabdd7..d0595b57 100644 --- a/src/modules/judge/rpc/push.go +++ b/src/modules/judge/rpc/push.go @@ -25,7 +25,7 @@ func (j *Judge) Send(items []*dataobj.JudgeItem, resp *dataobj.SimpleRpcResponse logger.Debug("recv-->", item) stats.Counter.Set("push.in", 1) - judge.ToJudge(cache.HistoryBigMap[pk[0:2]], pk, item, now) + go judge.ToJudge(cache.HistoryBigMap[pk[0:2]], pk, item, now) } return nil