This commit is contained in:
r-ca 2024-01-24 17:58:13 +09:00
parent f59c4445dc
commit f6bc9167d2
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -159,7 +159,7 @@ public class LacertaVcsImpl implements LacertaVcs {
ArrayList<VcsLogModel> vcsLogModels = new ArrayList<>(); ArrayList<VcsLogModel> vcsLogModels = new ArrayList<>();
VcsRevEntity vcsRevEntity = database.vcsRevDao().findById(revId); VcsRevEntity vcsRevEntity = database.vcsRevDao().findById(revId);
ArrayList<VcsLogEntity> vcsLogEntities = getLogInRev(vcsRevEntity); ArrayList<VcsLogEntity> vcsLogEntities = getLogInRevAsync(vcsRevEntity).join(); // TODO-rca: リファクタリング
vcsLogEntities.forEach(vcsLogEntity -> { vcsLogEntities.forEach(vcsLogEntity -> {
VcsLogModel vcsLogModel = new VcsLogModel(); VcsLogModel vcsLogModel = new VcsLogModel();
vcsLogModel.setId(vcsLogEntity.id); vcsLogModel.setId(vcsLogEntity.id);
@ -201,8 +201,8 @@ public class LacertaVcsImpl implements LacertaVcs {
}); });
} }
private ArrayList<VcsLogEntity> getLogInRev(VcsRevEntity revEntity) { private CompletableFuture<ArrayList<VcsLogEntity>> getLogInRevAsync(VcsRevEntity revEntity) {
return new ArrayList<>(database.vcsLogDao().findByIds(revEntity.logIds)); return CompletableFuture.supplyAsync(() -> new ArrayList<>(database.vcsLogDao().findByIds(revEntity.logIds)));
} }
@Override @Override