This commit is contained in:
cbs 2025-06-16 14:22:51 +08:00
parent 6bb201eb04
commit fc34d7f3b8

View File

@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@ -22,6 +23,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@EnableScheduling
@Component
@ -40,7 +42,7 @@ public class ThreeDimensionalScheduled {
private static final ExecutorService fixedThreadPool = Executors.newFixedThreadPool(3);
// 这个方法将每200毫秒执行一次
// @Scheduled(fixedDelay = 300, timeUnit = TimeUnit.MILLISECONDS)
@Scheduled(fixedDelay = 300, timeUnit = TimeUnit.MILLISECONDS)
public void executeTask() {
fixedThreadPool.execute(new Runnable() {
@Override