File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -167,18 +167,14 @@ export abstract class Queue {
167167 Queue . pgBoss = undefined
168168 }
169169
170- protected static startWorkers ( opts : {
170+ protected static async startWorkers ( opts : {
171171 maxConcurrentTasks : number
172172 signal ?: AbortSignal
173173 onMessage ?: ( job : Job ) => void
174174 } ) {
175- const workers : Promise < any > [ ] = [ ]
176-
177- Queue . events . forEach ( ( event ) => {
178- workers . push ( Queue . registerTask ( event , opts . maxConcurrentTasks , opts . onMessage , opts . signal ) )
179- } )
180-
181- return Promise . all ( workers )
175+ for ( const event of Queue . events ) {
176+ await Queue . registerTask ( event , opts . maxConcurrentTasks , opts . onMessage , opts . signal )
177+ }
182178 }
183179
184180 protected static callStart ( ) {
@@ -222,7 +218,7 @@ export abstract class Queue {
222218 retryBackoff : true ,
223219 } )
224220
225- // normal queue
221+ // // normal queue
226222 await this . pgBoss ?. createQueue ( queueName , {
227223 name : queueName ,
228224 ...queueOptions ,
You can’t perform that action at this time.
0 commit comments