1、多 key 默认拼成 1 条企微通知 2、UTF-8 超过 4096 字节 → 按 key 拆开,每条带完整抬头,依次发送 3、条间间隔 200ms,降低机器人限频风险 4、CI 控制台会标明「超长已按 key 拆为 N 条」并逐条打印
This commit is contained in:
@@ -11,6 +11,7 @@ import picocli.CommandLine.Command;
|
||||
import picocli.CommandLine.Option;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/**
|
||||
@@ -81,9 +82,11 @@ public class CacheSchemaCheckerMain implements Callable<Integer> {
|
||||
&& (report.hasChanges() || config.getNotify().isNotifyOnClean());
|
||||
if (shouldNotify && !dryRun) {
|
||||
String webhook = config.getNotify().getWebhookUrl();
|
||||
String markdown = builder.toMarkdown(report);
|
||||
boolean ok = new WeComNotifier().sendMarkdown(webhook, markdown);
|
||||
System.out.println("[cache-schema-checker] 企微通知发送: " + (ok ? "成功" : "失败/跳过"));
|
||||
List<String> messages = builder.toWeComMessages(report);
|
||||
int ok = new WeComNotifier().sendMarkdownMessages(webhook, messages);
|
||||
System.out.println("[cache-schema-checker] 企微通知发送: "
|
||||
+ ok + "/" + messages.size()
|
||||
+ (messages.size() > 1 ? "(已按 key 拆分)" : ""));
|
||||
}
|
||||
|
||||
if (report.isBlocked()) {
|
||||
|
||||
Reference in New Issue
Block a user