fix:钉钉消息限制
This commit is contained in:
@@ -30,12 +30,7 @@ public class MsgSendUtils {
|
|||||||
String cache = (String) redisService.get(redisKey);
|
String cache = (String) redisService.get(redisKey);
|
||||||
if (StringUtils.isNotBlank(cache)) {
|
if (StringUtils.isNotBlank(cache)) {
|
||||||
int sendNum = Integer.parseInt(cache);
|
int sendNum = Integer.parseInt(cache);
|
||||||
if (sendNum == 0) {
|
if (sendNum >= 0 && sendNum <= 5) {
|
||||||
jtDingTalkFactory.sendMsg(msgContent);
|
|
||||||
redisService.set(key, "0", 1, TimeUnit.HOURS);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (sendNum > 0 && sendNum <= 5) {
|
|
||||||
jtDingTalkFactory.sendMsg(msgContent);
|
jtDingTalkFactory.sendMsg(msgContent);
|
||||||
redisService.set(key, String.valueOf(++sendNum), 1, TimeUnit.HOURS);
|
redisService.set(key, String.valueOf(++sendNum), 1, TimeUnit.HOURS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public class JtVenuePullTask {
|
|||||||
|
|
||||||
String key = RedisKeyConstant.JNTYZX_VENUE_MSG_SEND_KEY + RedisKeyConstant.getDate();
|
String key = RedisKeyConstant.JNTYZX_VENUE_MSG_SEND_KEY + RedisKeyConstant.getDate();
|
||||||
msgSendUtils.sendMsgRestrict1Hours(key, msg.toString());
|
msgSendUtils.sendMsgRestrict1Hours(key, msg.toString());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user