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 {
167
167
Queue . pgBoss = undefined
168
168
}
169
169
170
- protected static startWorkers ( opts : {
170
+ protected static async startWorkers ( opts : {
171
171
maxConcurrentTasks : number
172
172
signal ?: AbortSignal
173
173
onMessage ?: ( job : Job ) => void
174
174
} ) {
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
+ }
182
178
}
183
179
184
180
protected static callStart ( ) {
@@ -222,7 +218,7 @@ export abstract class Queue {
222
218
retryBackoff : true ,
223
219
} )
224
220
225
- // normal queue
221
+ // // normal queue
226
222
await this . pgBoss ?. createQueue ( queueName , {
227
223
name : queueName ,
228
224
...queueOptions ,
You can’t perform that action at this time.
0 commit comments