fix: worker heartbeat use wrong thread pool

This commit is contained in:
tjq 2022-09-12 21:26:01 +08:00
parent e6d32c9a05
commit fd562d8ea0
2 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,10 @@ import tech.powerjob.server.common.module.ServerInfo;
*/ */
public interface ServerInfoService { public interface ServerInfoService {
/**
* fetch current server info
* @return ServerInfo
*/
ServerInfo fetchServiceInfo(); ServerInfo fetchServiceInfo();
} }

View File

@ -88,7 +88,6 @@ public class ServerInfoServiceImpl implements ServerInfoService {
log.info("[ServerInfoService] ip:{}, id:{}, cost:{}", ip, serverInfo.getId(), sw); log.info("[ServerInfoService] ip:{}, id:{}, cost:{}", ip, serverInfo.getId(), sw);
} }
@Async(PJThreadPool.TIMING_POOL)
@Scheduled(fixedRate = 15000, initialDelay = 15000) @Scheduled(fixedRate = 15000, initialDelay = 15000)
public void heartbeat() { public void heartbeat() {
serverInfoRepository.updateGmtModifiedByIp(serverInfo.getIp(), new Date()); serverInfoRepository.updateGmtModifiedByIp(serverInfo.getIp(), new Date());