Skip to content

Commit

Permalink
将实体发生改变清理缓存的动作由并行改回了串行
Browse files Browse the repository at this point in the history
  • Loading branch information
jovezhao committed Sep 7, 2020
1 parent 4755da9 commit 63d1d09
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public <T extends BaseEntity> T getEntity(Class tClass, Identifier identifier) {
Entity entity = entities
.stream()
.filter(p -> identifier.equals(p.getId()) && tClass.isInstance(p))
.filter(p->!p.is__deleted())
.findFirst()
.orElse(null);
return (T) entity;
Expand Down Expand Up @@ -69,7 +70,7 @@ private void commitEntity() {
// s.parallelStream().forEach(ss -> cacheClient.remove(EntityCacheUtils.getCacheKey(ss)));
}
entityNotify(r, s);
s.parallelStream().forEach(ss -> cacheClient.remove(EntityCacheUtils.getCacheKey(ss)));
s.forEach(ss -> cacheClient.remove(EntityCacheUtils.getCacheKey(ss)));
});
});

Expand Down

0 comments on commit 63d1d09

Please sign in to comment.