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