From b726dc97538b7d4ba71fd06c14161017dd67c2b7 Mon Sep 17 00:00:00 2001
From: xubinbin <1323875150@qq.com>
Date: 星期三, 10 五月 2023 15:38:22 +0800
Subject: [PATCH] "@schedule"是Spring框架提供的一种定时任务执行机制,默认情况下它是单线程执行,项目中多次使用fixedRate按指定频率执行任务(不管前面任务是否已经完成),在同时执行多个定时任务时可能会出现阻塞和性能问题,为了解决这种单线程瓶颈问题,将定时任务的执行机制改为支持多线程

---
 src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java
index 29b2d8d..fa12679 100644
--- a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java
+++ b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java
@@ -2,6 +2,7 @@
 
 import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
 import com.genersoft.iot.vmp.utils.DateUtil;
+import org.junit.jupiter.api.Order;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
@@ -14,6 +15,7 @@
 
 
 @Configuration("mediaConfig")
+@Order(0)
 public class MediaConfig{
 
     private final static Logger logger = LoggerFactory.getLogger(MediaConfig.class);
@@ -25,7 +27,7 @@
     @Value("${media.ip}")
     private String ip;
 
-    @Value("${media.hook-ip:${sip.ip}}")
+    @Value("${media.hook-ip:}")
     private String hookIp;
 
     @Value("${sip.ip}")
@@ -86,7 +88,7 @@
 
     public String getHookIp() {
         if (ObjectUtils.isEmpty(hookIp)){
-            return sipIp;
+            return sipIp.split(",")[0];
         }else {
             return hookIp;
         }

--
Gitblit v1.8.0