xiaoyong931011
2023-03-29 d59e8ac990635b0d9adf6873e64b66eb7db57147
后台修改
1 files added
17 ■■■■■ changed files
src/main/java/cc/mrbird/febs/restart/RestartJob.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/restart/RestartJob.java
New file
@@ -0,0 +1,17 @@
package cc.mrbird.febs.restart;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException;
@Slf4j
@Component
public class RestartJob {
    @Scheduled(cron = "0 40 * * * ? ")
    public void autoRestart() throws IOException {
        String shellpath="sh /home/javaweb/cron/reset-mall-rabbit.sh";
        Process ps = Runtime.getRuntime().exec(shellpath);
    }
}