| | |
| | | package com.zt.task; |
| | | |
| | | import com.zt.common.utils.CommonUtils; |
| | | import com.zt.life.modules.mainPart.basicInfo.service.XhProductModelService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | @Autowired |
| | | XhProductModelService xhProductModelService; |
| | | |
| | | |
| | | @Scheduled(cron = "0 0 3 * * ?") //每天3点执行 |
| | | public void task() { |
| | | logger.info("更新数据task开始"); |
| | | Date beginDate = new Date(); |
| | | |
| | | xhProductModelService.refreshCache(); |
| | | purgeRedis(); |
| | | |
| | | logger.info("更新数据task耗时:" + CommonUtils.getDatePoor(new Date(), beginDate)); |