From 5b8db7322d079fecc3fda06a38c88d65265f78c2 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Tue, 3 Oct 2023 17:32:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8E=86=E5=8F=B2=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E6=9F=A5=E8=AF=A2(=E8=B0=83=E6=95=B4/=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=87=8D=E6=9E=84)=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docking/gb28181/service/record/RecordService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/record/RecordService.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/record/RecordService.java index dd3c999..e46f9c6 100644 --- a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/record/RecordService.java +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/record/RecordService.java @@ -95,8 +95,8 @@ public class RecordService { subscribe.getSipRequestSubscribe().addPublisher(key); Flow.Subscriber subscriber = new Flow.Subscriber<>() { final List list = new ArrayList<>(); - AtomicLong atomicSum = new AtomicLong(0); - AtomicLong atomicNum = new AtomicLong(0); + final AtomicLong atomicSum = new AtomicLong(0); + final AtomicLong atomicNum = new AtomicLong(0); Flow.Subscription subscription; @Override @@ -109,8 +109,8 @@ public class RecordService { @Override public void onNext(SIPRequest item) { RecordInfoResponseDTO data = MANSCDPUtils.parse(item.getRawContent(), RecordInfoResponseDTO.class); - atomicSum.set(data.getSumNum()); - atomicNum.getAndAdd(data.getRecordList().getNum()); + atomicSum.set(Math.max(data.getSumNum(), atomicNum.get())); + atomicNum.addAndGet(data.getRecordList().getNum()); list.addAll(data.getRecordList().getRecordList()); long num = atomicNum.get(); long sum = atomicSum.get();