Skip to content

Commit da0477c

Browse files
author
GuoHao
authored
fix: 条目同步重复拉取的问题 (#583)
1 parent 5b67bee commit da0477c

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CHANGELOG.MD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
更新日志文档,版本顺序从新到旧,最新版本在最前(上)面。
44

5+
# 0.12.3
6+
7+
## 问题修复
8+
9+
- 条目同步重复拉取的问题
10+
511
# 0.12.2
612

713
## 问题修复

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.12.2
1+
version=0.12.3

server/src/main/java/run/ikaros/server/core/subject/service/impl/SubjectSyncPlatformServiceImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ public synchronized Mono<Subject> sync(@Nullable Long subjectId, SubjectSyncPlat
5454
Assert.notNull(platform, "'platform' must not null.");
5555
Assert.hasText(platformId, "'platformId' must has text.");
5656
// 查询是否已经同步过了,如果已经同步过则返回对应的条目信息
57-
return subjectSyncRepository.findBySubjectIdAndPlatformAndPlatformId(
58-
subjectId, platform, platformId)
57+
return subjectSyncRepository.findByPlatformAndPlatformId(platform, platformId)
58+
.collectList()
59+
.filter(subjectSyncEntities -> !subjectSyncEntities.isEmpty())
60+
.map(subjectSyncEntities -> subjectSyncEntities.get(0))
5961
.map(SubjectSyncEntity::getSubjectId)
6062
.flatMap(subjectService::findById)
6163
.switchIfEmpty(syncBySubjectSynchronizer(subjectId, platform, platformId));

0 commit comments

Comments
 (0)