Fix pg pool starvation (#1205)

This commit is contained in:
Zoe Roux
2025-12-07 14:40:44 +01:00
committed by GitHub
parent 58603c5180
commit fc7deb8e09
2 changed files with 6 additions and 5 deletions
+5 -1
View File
@@ -100,7 +100,11 @@ export const processImages = record("processImages", async () => {
let found = true;
while (found) {
found = await processOne();
// run 10 downloads at the same time,
// if one of them couldn't find an item the queue is empty.
found = !(
await Promise.all([new Array(10)].map(() => processOne()))
).includes(false);
}
running = false;
}