File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
packages/cli-v3/src/entryPoints/managed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export class RunExecution {
6666 private snapshotPoller ?: RunExecutionSnapshotPoller ;
6767
6868 private lastHeartbeat ?: Date ;
69+ private isShuttingDown = false ;
6970
7071 constructor ( opts : RunExecutionOptions ) {
7172 this . id = randomBytes ( 4 ) . toString ( "hex" ) ;
@@ -163,6 +164,11 @@ export class RunExecution {
163164 * or when the snapshot poller detects a change
164165 */
165166 public async handleSnapshotChange ( runData : RunExecutionData ) : Promise < void > {
167+ if ( this . isShuttingDown ) {
168+ this . sendDebugLog ( "handleSnapshotChange: shutting down, skipping" ) ;
169+ return ;
170+ }
171+
166172 const { run, snapshot, completedWaitpoints } = runData ;
167173
168174 const snapshotMetadata = {
@@ -985,6 +991,11 @@ export class RunExecution {
985991 }
986992
987993 private stopServices ( ) {
994+ if ( this . isShuttingDown ) {
995+ return ;
996+ }
997+
998+ this . isShuttingDown = true ;
988999 this . snapshotPoller ?. stop ( ) ;
9891000 this . taskRunProcess ?. onTaskRunHeartbeat . detach ( ) ;
9901001 }
You can’t perform that action at this time.
0 commit comments