增加自检跳过机制:TMS_SELFCHECK_SKIP=true

This commit is contained in:
cheney 2026-05-15 15:05:09 +08:00
parent a177277f04
commit 37337526c3

View File

@ -18,12 +18,21 @@ public class SelfCheckStartupRunner implements CommandLineRunner {
@Autowired
private SelfCheckService selfCheckService;
private static final String SELFCHECK_SKIP_ENV = "TMS_SELFCHECK_SKIP";
@Override
public void run(String... args) throws Exception {
log.info("══════════════════════════════════════════════════════════════");
log.info(" 系统启动自检流程");
log.info("══════════════════════════════════════════════════════════════");
String skipSelfCheck = System.getenv(SELFCHECK_SKIP_ENV);
if ("true".equalsIgnoreCase(skipSelfCheck)) {
log.warn("检测到环境变量 {}=true跳过自检流程", SELFCHECK_SKIP_ENV);
log.info("══════════════════════════════════════════════════════════════");
return;
}
try {
List<SelfCheckResult> results = selfCheckService.executeAllChecks();