File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -817,7 +817,7 @@ export function _runTaskList(
817
817
}
818
818
}
819
819
}
820
- if ( jobsToRelease . length > 0 ) {
820
+ if ( ! this . _forcefulShuttingDown && jobsToRelease . length > 0 ) {
821
821
const workerIds = workers . map ( ( worker ) => worker . workerId ) ;
822
822
logger . debug (
823
823
`Releasing the jobs ${ jobsToRelease
@@ -839,7 +839,16 @@ export function _runTaskList(
839
839
cancelledJobs,
840
840
} ) ;
841
841
}
842
- if ( errors . length > 0 ) {
842
+ if ( this . _forcefulShuttingDown ) {
843
+ errors . push (
844
+ new Error (
845
+ "forcefulShutdown was initiated whilst gracefulShutdown was still executing." ,
846
+ ) ,
847
+ ) ;
848
+ }
849
+ if ( errors . length === 1 ) {
850
+ throw errors [ 0 ] ;
851
+ } else if ( errors . length > 1 ) {
843
852
throw new AggregateError (
844
853
errors ,
845
854
"Errors occurred whilst shutting down worker" ,
You can’t perform that action at this time.
0 commit comments