Skip to content

Commit 86c92cb

Browse files
committed
fix(elysia): add await for /queries
1 parent 9d70c03 commit 86c92cb

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

frameworks/TypeScript/elysia/src/db-handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const dbHandlers = new Elysia()
5555
const worldPromises = new Array(num);
5656
for (let i = 0; i < num; i++) worldPromises[i] = find(rand());
5757

58-
return Promise.all(worldPromises);
58+
return await Promise.all(worldPromises);
5959
})
6060
.get("/updates", async (c) => {
6161
const num = parseQueriesNumber(c.query.queries);

frameworks/TypeScript/elysia/src/postgres.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export const findThenRand = (id: number) =>
2424
}) as Promise<World[]>;
2525

2626
export const bulkUpdate = (worlds: World[]) => {
27-
worlds = worlds.toSorted((a, b) => a.id - b.id);
28-
2927
const values = new Array(worlds.length);
3028
for (let i = 0; i < worlds.length; i++)
3129
values[i] = [worlds[i].id, worlds[i].randomNumber];

0 commit comments

Comments
 (0)