Skip to content

Commit 62bf7cd

Browse files
committed
fix(docs): correct interval calculation in worker heartbeat check
Update the SQL query to use make_interval(secs => 6) for accurate heartbeat interval comparison.
1 parent 8c575a1 commit 62bf7cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkgs/website/src/content/docs/how-to/keep-workers-up.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This approach checks existing worker counts before spawning new ones:
4141
WHERE (
4242
SELECT COUNT(DISTINCT worker_id) FROM pgflow.workers
4343
WHERE function_name = 'your-worker-name'
44-
AND last_heartbeat_at > NOW() - INTERVAL '2 min'
44+
AND last_heartbeat_at > NOW() - make_interval(secs => 6)
4545
) < 2;
4646
$$
4747
);

0 commit comments

Comments
 (0)