xiaoyong931011
2023-03-29 b50ce4f17ad242f8e27d9fae71ee4c01623a5983
后台修改
1 files modified
7 ■■■■ changed files
src/main/java/cc/mrbird/febs/restart/RestartJob.java 7 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/restart/RestartJob.java
@@ -9,7 +9,12 @@
@Slf4j
@Component
public class RestartJob {
    @Scheduled(cron = "0 40 * * * ? ")
    /**
     * 每天凌晨一点,去shellpath目录下运行reset-mall-rabbit.sh脚本文件,实现项目的每日定时重启
     * 目的:BSC的区块链监听问题,解决重连问题
     * @throws IOException
     */
    @Scheduled(cron = "0 0 1 * * ? ")
    public void autoRestart() throws IOException {
        String shellpath="sh /home/javaweb/cron/reset-mall-rabbit.sh";
        Process ps = Runtime.getRuntime().exec(shellpath);