From 78f628dd6fca9be675376a20a753b6f4556e9844 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 12 十月 2023 17:01:25 +0800
Subject: [PATCH] 修复同步目录时批量提交的错误
---
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java | 16 ++--------------
1 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
index e96e09b..d406225 100755
--- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -169,7 +169,7 @@
}
}
}
- if (channels.size() > 0) {
+ if (!channels.isEmpty()) {
for (DeviceChannel channel : channels) {
if (subContMap.get(channel.getChannelId()) != null){
Integer count = subContMap.get(channel.getChannelId());
@@ -190,19 +190,7 @@
}
try {
int limitCount = 50;
- int cleanChannelsResult = 0;
- if (channels.size() > limitCount) {
- for (int i = 0; i < channels.size(); i += limitCount) {
- int toIndex = i + limitCount;
- if (i + limitCount > channels.size()) {
- toIndex = channels.size();
- }
- cleanChannelsResult += this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels.subList(i, toIndex));
- }
- } else {
- cleanChannelsResult = this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels);
- }
- boolean result = cleanChannelsResult < 0;
+ boolean result = false;
if (!result && addChannels.size() > 0) {
if (addChannels.size() > limitCount) {
for (int i = 0; i < addChannels.size(); i += limitCount) {
--
Gitblit v1.8.0