2025-11-27 19:07:55 +08:00

22 lines
608 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.czlis.interfaceCommon.websocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class RetryMsgTask {
@Autowired
private RetryMsgService retryMsgService;
/**
* 每5秒执行一次(若依框架支持cron表达式或fixedRate)
*/
@Scheduled(fixedRate = 5000)
public void executeRetry() {
// 多线程处理,避免阻塞定时任务线程
new Thread(retryMsgService::retryProcessMsg).start();
}
}