Skip to content

Commit ef8e0e5

Browse files
world-postgres: poll faster in pg-boss (#463)
--------- Signed-off-by: Gal Schlezinger <[email protected]> Co-authored-by: Peter Wielander <[email protected]>
1 parent 109fe59 commit ef8e0e5

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.changeset/eight-emus-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@workflow/world-postgres": patch
3+
---
4+
5+
Increase polling interval for pg-boss to reduce interval between steps

packages/world-postgres/src/queue.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,15 @@ export function createQueue(
8484
await createQueue(jobName);
8585
await Promise.all(
8686
Array.from({ length: config.queueConcurrency || 10 }, async () => {
87-
await boss.work(jobName, work);
87+
await boss.work(
88+
jobName,
89+
{
90+
// The default is 2s, which is far too slow for running steps in quick succession.
91+
// The min is 0.5s, which is still too slow. We should move to a pg NOTIFY/LISTEN-based job system.
92+
pollingIntervalSeconds: 0.5,
93+
},
94+
work
95+
);
8896
})
8997
);
9098

0 commit comments

Comments
 (0)