From f6bc9167d232b3b4d8d71d592e7daa505bc74a4b Mon Sep 17 00:00:00 2001 From: r-ca Date: Wed, 24 Jan 2024 17:58:13 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java b/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java index ed81a493..280628aa 100644 --- a/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java +++ b/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java @@ -159,7 +159,7 @@ public class LacertaVcsImpl implements LacertaVcs { ArrayList vcsLogModels = new ArrayList<>(); VcsRevEntity vcsRevEntity = database.vcsRevDao().findById(revId); - ArrayList vcsLogEntities = getLogInRev(vcsRevEntity); + ArrayList vcsLogEntities = getLogInRevAsync(vcsRevEntity).join(); // TODO-rca: リファクタリング vcsLogEntities.forEach(vcsLogEntity -> { VcsLogModel vcsLogModel = new VcsLogModel(); vcsLogModel.setId(vcsLogEntity.id); @@ -201,8 +201,8 @@ public class LacertaVcsImpl implements LacertaVcs { }); } - private ArrayList getLogInRev(VcsRevEntity revEntity) { - return new ArrayList<>(database.vcsLogDao().findByIds(revEntity.logIds)); + private CompletableFuture> getLogInRevAsync(VcsRevEntity revEntity) { + return CompletableFuture.supplyAsync(() -> new ArrayList<>(database.vcsLogDao().findByIds(revEntity.logIds))); } @Override