Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ws-man-bridge] don't update stopped workspaces #5234

Merged
merged 1 commit into from
Aug 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions components/ws-manager-bridge/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,16 @@ export class WorkspaceManagerBridge implements Disposable {
instance.status.phase = "interrupted";
break;
case WorkspacePhase.STOPPING:
instance.status.phase = "stopping";
if (!instance.stoppingTime) {
// The first time a workspace enters stopping we record that as it's stoppingTime time.
// This way we don't take the time a workspace requires to stop into account when
// computing the time a workspace instance was running.
instance.stoppingTime = new Date().toISOString();
if (instance.status.phase != 'stopped') {
instance.status.phase = "stopping";
if (!instance.stoppingTime) {
// The first time a workspace enters stopping we record that as it's stoppingTime time.
// This way we don't take the time a workspace requires to stop into account when
// computing the time a workspace instance was running.
instance.stoppingTime = new Date().toISOString();
}
} else {
log.warn("Got a stopping event for an already stopped workspace.", instance);
}
break;
case WorkspacePhase.STOPPED:
Expand Down