Pārlūkot izejas kodu

fix(tag): 防止空数据批量插入队列

- 在批量插入前增加空数据检查- 避免因空数据导致的数据库异常
- 提升标签更新服务的健壮性
xw 1 nedēļu atpakaļ
vecāks
revīzija
58e4403a0a

+ 6 - 2
fs-service/src/main/java/com/fs/tag/service/impl/FsTagUpdateServiceImpl.java

@@ -175,7 +175,9 @@ public class FsTagUpdateServiceImpl implements FsTagUpdateService {
         }
 
 
-        fsTagUpdateQueueMapper.batchInsert(batchData);
+        if(CollectionUtils.isNotEmpty(batchData)) {
+            fsTagUpdateQueueMapper.batchInsert(batchData);
+        }
     }
 
 
@@ -257,7 +259,9 @@ public class FsTagUpdateServiceImpl implements FsTagUpdateService {
         }
 
 
-        fsTagUpdateQueueMapper.batchInsert(batchData);
+        if(CollectionUtils.isNotEmpty(batchData)) {
+            fsTagUpdateQueueMapper.batchInsert(batchData);
+        }
     }
 
     @Override