ScheduleAdjustTask.java 649 B

1234567891011121314151617181920212223242526272829
  1. package com.xjrsoft.module.job;
  2. import cn.hutool.extra.spring.SpringUtil;
  3. import lombok.extern.slf4j.Slf4j;
  4. import org.springframework.scheduling.annotation.Scheduled;
  5. import org.springframework.stereotype.Component;
  6. /**
  7. * @author dzx
  8. * @date 2024/1/25
  9. */
  10. @Component
  11. @Slf4j
  12. public class ScheduleAdjustTask {
  13. @Scheduled(cron = "0 0 22 * * ?")
  14. public void RefreshConnectionPool() {
  15. String active = SpringUtil.getActiveProfile();
  16. if("prod".equals(active)){
  17. log.info("非正式环境,无法执行获取课表数据");
  18. return;
  19. }
  20. //doExecute();
  21. }
  22. void doExecute(){
  23. }
  24. }