Skip to content

Commit 1545951

Browse files
committed
Fixes problem in PgClientRepository.getFortunes().
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
1 parent b754cb8 commit 1545951

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientRepository.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,18 @@ private List<World> updateWorldsRetry(List<World> worlds, int from, int retries)
158158

159159
@Override
160160
public List<Fortune> getFortunes() {
161-
return getFortuneQuery.execute()
162-
.map(rows -> {
163-
List<Fortune> fortunes = new ArrayList<>(rows.size() + 1);
164-
for (Row r : rows) {
165-
fortunes.add(new Fortune(r.getInteger(0), r.getString(1)));
166-
}
167-
return fortunes;
168-
}).result();
161+
try {
162+
return getFortuneQuery.execute()
163+
.map(rows -> {
164+
List<Fortune> fortunes = new ArrayList<>(rows.size() + 1);
165+
for (Row r : rows) {
166+
fortunes.add(new Fortune(r.getInteger(0), r.getString(1)));
167+
}
168+
return fortunes;
169+
}).toCompletionStage().toCompletableFuture().get();
170+
} catch (Exception e) {
171+
throw new RuntimeException(e);
172+
}
169173
}
170174

171175
private CompletableFuture<List<World>> updateWorlds(List<World> worlds, int from, SqlClient pool) {

0 commit comments

Comments
 (0)