Browse Source

发送标志位修改

Jianghan 1 year ago
parent
commit
f93ff30999
1 changed files with 4 additions and 4 deletions
  1. 4 4
      clueSync/sendMail.go

+ 4 - 4
clueSync/sendMail.go

@@ -39,12 +39,12 @@ func WarningPerl() {
 			sendFlag2 := common.IntAll(m["flag_2"]) //上限邮件发送
 			posid := common.Int64All(m["position_id"])
 			count := TiDb.CountBySql(sql, posid)
-			if count >= cfg.WarningValue && sendFlag1 == 0 {
-				WillWarningByPp(posid) // 发预警邮件
-				_, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail | (1 << 0)"), posid)
-			} else if count >= cfg.AllocationCap && sendFlag2 == 0 {
+			if count >= cfg.AllocationCap && sendFlag2 == 0 {
 				ExceedLimitByPp(posid) // 发上限邮件
 				_, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail | (1 << 1)"), posid)
+			} else if count >= cfg.WarningValue && sendFlag1 == 0 && sendFlag2 == 0 {
+				WillWarningByPp(posid) // 发预警邮件
+				_, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail | (1 << 0)"), posid)
 			} else if sendFlag1 == 1 && count < cfg.WarningValue { // 已发邮件
 				_, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail & ~(1 << 0)"), posid)
 			} else if sendFlag2 == 1 && count < cfg.AllocationCap { // 已发邮件