9 changed files with 98 additions and 22 deletions
@ -0,0 +1,39 @@ |
|||
package com.qs.serve.task; |
|||
|
|||
import com.qs.serve.common.framework.redis.RedisService; |
|||
import com.qs.serve.common.model.consts.RedisCacheKeys; |
|||
import com.qs.serve.common.util.AuthContextUtils; |
|||
import com.qs.serve.modules.his.service.HisUserSupplierTempService; |
|||
import com.qs.serve.modules.tag.mapper.TagDataMapper; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|||
import org.springframework.scheduling.annotation.Scheduled; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.time.Duration; |
|||
import java.time.LocalDateTime; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2023/5/31 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@AllArgsConstructor |
|||
@ConditionalOnProperty(value = "project.task", havingValue = "true") |
|||
public class TagTask { |
|||
|
|||
private TagDataMapper tagDataMapper; |
|||
|
|||
/** |
|||
* 数据处理10-15分钟,清理过期数据 |
|||
*/ |
|||
@Scheduled(cron="0 0/1 * * * ?") |
|||
public void buildTempTable(){ |
|||
tagDataMapper.deleteExpireData(); |
|||
} |
|||
|
|||
|
|||
} |
Loading…
Reference in new issue