暂态文件同步二次开发
This commit is contained in:
41
filesync/src/main/java/com/njcn/job/EventWavePathJob.java
Normal file
41
filesync/src/main/java/com/njcn/job/EventWavePathJob.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.njcn.job;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.njcn.filesync.service.FileSyncService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/12/08 上午 10:47【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Component
|
||||
@EnableScheduling
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class EventWavePathJob {
|
||||
|
||||
private final FileSyncService fileSyncService;
|
||||
// 每10分钟执行
|
||||
@Scheduled(cron = "0 0/10 * * * ? ")
|
||||
public void UpHarmonicJob(){
|
||||
String endTime = LocalDateTimeUtil.format(LocalDateTime.now(), DatePattern.NORM_DATETIME_PATTERN);
|
||||
String startTime =LocalDateTimeUtil.format(LocalDateTime.now().minusMinutes(30), DatePattern.NORM_DATETIME_PATTERN);
|
||||
log.info("begin sync------------------" +
|
||||
startTime+"---"+endTime+"eventFile");
|
||||
fileSyncService.EventWavePathSYnc(startTime,endTime);
|
||||
log.info("end sync------------------" +
|
||||
startTime+"---"+endTime+"eventFile");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user