fix(subscriptions): change const done to let and resolve with finally to allow while loop to exit

This commit is contained in:
Maks Pikov
2026-04-02 22:21:42 +00:00
parent c7b5e73d1c
commit 5978c4135e
6 changed files with 59 additions and 54 deletions

View File

@@ -233,11 +233,15 @@ export const postgresRouter = createTRPCRouter({
});
const queue: string[] = [];
const done = false;
let done = false;
deployPostgres(input.postgresId, (log) => {
queue.push(log);
});
})
.catch(() => {})
.finally(() => {
done = true;
});
while (!done || queue.length > 0) {
if (queue.length > 0) {