Skip to content

Commit

Permalink
fix: 条目同步重复拉取的问题 (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoHao authored Jun 17, 2024
1 parent 5b67bee commit da0477c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

# 0.12.3

## 问题修复

- 条目同步重复拉取的问题

# 0.12.2

## 问题修复
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.12.2
version=0.12.3
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ public synchronized Mono<Subject> sync(@Nullable Long subjectId, SubjectSyncPlat
Assert.notNull(platform, "'platform' must not null.");
Assert.hasText(platformId, "'platformId' must has text.");
// 查询是否已经同步过了,如果已经同步过则返回对应的条目信息
return subjectSyncRepository.findBySubjectIdAndPlatformAndPlatformId(
subjectId, platform, platformId)
return subjectSyncRepository.findByPlatformAndPlatformId(platform, platformId)
.collectList()
.filter(subjectSyncEntities -> !subjectSyncEntities.isEmpty())
.map(subjectSyncEntities -> subjectSyncEntities.get(0))
.map(SubjectSyncEntity::getSubjectId)
.flatMap(subjectService::findById)
.switchIfEmpty(syncBySubjectSynchronizer(subjectId, platform, platformId));
Expand Down

0 comments on commit da0477c

Please sign in to comment.