File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -93,18 +93,20 @@ main().catch((e) => {
9393async function forEmptyQueue ( pgPool ) {
9494 let remaining ;
9595 do {
96+ await sleep ( 2000 ) ;
9697 const {
9798 rows : [ row ] ,
9899 } = await pgPool . query (
99100 `\
100- select count(*)
101- from graphile_worker._private_jobs as jobs
102- where task_id = (
103- select id from graphile_worker._private_tasks as tasks
104- where identifier = 'latency'
101+ select exists(
102+ select 1
103+ from graphile_worker._private_jobs as jobs
104+ where task_id = (
105+ select id from graphile_worker._private_tasks as tasks
106+ where identifier = 'latency'
107+ )
105108)` ,
106109 ) ;
107- remaining = ( row && row . count ) || 0 ;
108- await sleep ( 2000 ) ;
109- } while ( remaining > 0 ) ;
110+ remaining = row . exists ;
111+ } while ( remaining ) ;
110112}
You can’t perform that action at this time.
0 commit comments