Skip to content

Commit

Permalink
fixup! prevent workspace restarting if user intentionally stopped it
Browse files Browse the repository at this point in the history
  • Loading branch information
akurinnoy committed Oct 8, 2019
1 parent 58e66eb commit 9c677ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions workspace-loader/src/workspace-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class WorkspaceLoader {

// `false` if workspace has been stopped intentionally
// and workspace-loader should not restart it
private doRestart: boolean = true;
private allowRestart: boolean = true;

constructor(
private readonly loader: Loader,
Expand Down Expand Up @@ -210,7 +210,7 @@ export class WorkspaceLoader {

if (message.status === 'STOPPING') {
if (message.prevStatus === 'STARTING') {
this.doRestart = false;
this.allowRestart = false;
}
}

Expand All @@ -219,14 +219,14 @@ export class WorkspaceLoader {
this.loader.error('Workspace stopped.');
this.runtimeIsAccessible.reject('Workspace stopped.');
}
if (message.prevStatus === 'STOPPING' && this.doRestart) {
if (message.prevStatus === 'STOPPING' && this.allowRestart) {
try {
await this.startWorkspace();
} catch (e) {
this.runtimeIsAccessible.reject(e);
}
}
this.doRestart = true;
this.allowRestart = true;
}
}

Expand Down

0 comments on commit 9c677ed

Please sign in to comment.