| | |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | @Component |
| | | @Order(value=1) |
| | | @Order(value=2) |
| | | public class ZLMRunner implements CommandLineRunner { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(ZLMRunner.class); |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | // 获取zlm信息 |
| | | logger.info("[zlm] 等待默认zlm中..."); |
| | | |
| | |
| | | } |
| | | for (MediaServerItem mediaServerItem : all) { |
| | | if (startGetMedia == null) { |
| | | startGetMedia = new HashMap<>(); |
| | | startGetMedia = new ConcurrentHashMap<>(); |
| | | } |
| | | startGetMedia.put(mediaServerItem.getId(), true); |
| | | connectZlmServer(mediaServerItem); |
| | |
| | | } |
| | | String taskKey = "zlm-connect-timeout"; |
| | | dynamicTask.startDelay(taskKey, ()->{ |
| | | if (startGetMedia != null) { |
| | | if (startGetMedia != null && startGetMedia.size() > 0) { |
| | | Set<String> allZlmId = startGetMedia.keySet(); |
| | | for (String id : allZlmId) { |
| | | logger.error("[ {} ]]主动连接失败,不再尝试连接", id); |