package com.bizzan.bitrade.job;

import com.bizzan.bitrade.util.WebSocketConnectionManage;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class CheckWebSocketJob {
    /**
     * 10秒检查一次，WebSocketBinance 内部已有 watchdog，这里做兜底触发
     */
    @Scheduled(cron = "*/10 * * * * *")
    public void checkWebSocket() {
        if (WebSocketConnectionManage.getWebSocket() != null) {
            WebSocketConnectionManage.getWebSocket().checkConnections();
        }
    }
}
