File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,9 @@ export class WorkerInfo extends AsynchronouslyCreatedResource {
6262 if ( this . terminating || this . destroyed ) return ;
6363
6464 this . terminating = true ;
65+ this . clearIdleTimeout ( ) ;
6566 this . worker . terminate ( ) ;
6667 this . port . close ( ) ;
67- this . clearIdleTimeout ( ) ;
6868 for ( const taskInfo of this . taskInfos . values ( ) ) {
6969 taskInfo . done ( Errors . ThreadTermination ( ) ) ;
7070 }
@@ -121,7 +121,6 @@ export class WorkerInfo extends AsynchronouslyCreatedResource {
121121 } ;
122122
123123 try {
124- this . clearIdleTimeout ( ) ;
125124 this . port . postMessage ( message , taskInfo . transferList ) ;
126125 } catch ( err ) {
127126 // This would mostly happen if e.g. message contains unserializable data
@@ -132,6 +131,7 @@ export class WorkerInfo extends AsynchronouslyCreatedResource {
132131
133132 taskInfo . workerInfo = this ;
134133 this . taskInfos . set ( taskInfo . taskId , taskInfo ) ;
134+ queueMicrotask ( ( ) => this . clearIdleTimeout ( ) )
135135 this . ref ( ) ;
136136
137137 // Inform the worker that there are new messages posted, and wake it up
You can’t perform that action at this time.
0 commit comments