Merge pull request #445 from didi/dev

优化corn表达式解析失败后退出无任何日志提示问题
This commit is contained in:
EricZeng
2022-01-20 10:22:16 +08:00
committed by GitHub
2 changed files with 4 additions and 6 deletions

View File

@@ -80,10 +80,9 @@ public abstract class AbstractScheduledTask<E extends Comparable> implements Sch
return true;
}
LOGGER.error("modify scheduledCron failed, format invalid, scheduledName:{} scheduledCron:{}."
, scheduledName, scheduledCron);
LOGGER.error("modify scheduledCron failed, format invalid, scheduledName:{} scheduledCron:{}.", scheduledName, scheduledCron);
if (existIfIllegal) {
System.exit(0);
throw new UnsupportedOperationException(String.format("scheduledName:%s scheduledCron:%s format invalid", scheduledName, scheduledCron));
}
return false;
}

View File

@@ -3,7 +3,6 @@ package com.xiaojukeji.kafka.manager.web;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
@@ -17,7 +16,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableAsync
@EnableScheduling
@ServletComponentScan
@EnableAutoConfiguration
@SpringBootApplication(scanBasePackages = {"com.xiaojukeji.kafka.manager"})
public class MainApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(MainApplication.class);
@@ -28,7 +26,8 @@ public class MainApplication {
sa.run(args);
LOGGER.info("MainApplication started");
} catch (Exception e) {
e.printStackTrace();
LOGGER.error("start failed and application exit", e);
System.exit(1);
}
}
}