ScheduleJob.java 824 B

123456789101112131415161718192021222324252627
  1. package com.fdkankan.scene.schedule;
  2. import com.fdkankan.scene.service.ISceneAsynOperLogService;
  3. import lombok.extern.log4j.Log4j2;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.cloud.context.config.annotation.RefreshScope;
  6. import org.springframework.scheduling.annotation.Scheduled;
  7. import org.springframework.stereotype.Component;
  8. @RefreshScope
  9. @Log4j2
  10. @Component
  11. public class ScheduleJob {
  12. @Autowired
  13. private ISceneAsynOperLogService sceneAsynOperLogService;
  14. /**
  15. * 每天凌晨一点执行
  16. */
  17. @Scheduled(cron="0 0 1 * * ?")
  18. public void cleanDownloadPanorama() {
  19. log.info("定时清除全景图压缩包开始");
  20. sceneAsynOperLogService.cleanDownloadPanorama();
  21. log.info("定时清除全景图压缩包完毕");
  22. }
  23. }