From 5cae58c69129631c80c611d1870c3a20721cebf4 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 14 二月 2023 10:04:48 +0800 Subject: [PATCH] Merge branch 'wvp-28181-2.0' into main2 --- src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java index 9113268..94646bb 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java @@ -30,7 +30,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Component; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import javax.sip.InvalidArgumentException; import javax.sip.RequestEvent; @@ -76,8 +75,6 @@ @Autowired private IDeviceChannelService deviceChannelService; - private boolean taskQueueHandlerRun = false; - private ConcurrentLinkedQueue<HandlerCatchData> taskQueue = new ConcurrentLinkedQueue<>(); @Qualifier("taskExecutor") @@ -97,9 +94,9 @@ }catch (SipException | InvalidArgumentException | ParseException e) { e.printStackTrace(); } + boolean runed = !taskQueue.isEmpty(); taskQueue.offer(new HandlerCatchData(evt, null, null)); - if (!taskQueueHandlerRun) { - taskQueueHandlerRun = true; + if (!runed) { taskExecutor.execute(()-> { try { while (!taskQueue.isEmpty()) { @@ -130,8 +127,6 @@ } }catch (Exception e) { logger.error("澶勭悊NOTIFY娑堟伅鏃堕敊璇�", e); - }finally { - taskQueueHandlerRun = false; } }); } -- Gitblit v1.8.0