File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
components/ws-manager-bridge/src Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -618,12 +618,18 @@ export class WorkspaceManagerBridge implements Disposable {
618
618
619
619
protected async markWorkspaceInstanceAsStopped ( ctx : TraceContext , info : RunningWorkspaceInfo , now : Date ) {
620
620
const nowISO = now . toISOString ( ) ;
621
- info . latestInstance . stoppingTime = nowISO ;
621
+ if ( ! info . latestInstance . stoppingTime ) {
622
+ info . latestInstance . stoppingTime = nowISO ;
623
+ }
622
624
info . latestInstance . stoppedTime = nowISO ;
623
625
info . latestInstance . status . message = `Stopped by ws-manager-bridge. Previously in phase ${ info . latestInstance . status . phase } ` ;
624
626
info . latestInstance . status . phase = "stopped" ;
625
627
await this . workspaceDB . trace ( ctx ) . storeInstance ( info . latestInstance ) ;
626
628
629
+ // cleanup
630
+ // important: call this after the DB update
631
+ await this . onInstanceStopped ( ctx , info . workspace . ownerId , info . latestInstance ) ;
632
+
627
633
await this . messagebus . notifyOnInstanceUpdate ( ctx , info . workspace . ownerId , info . latestInstance ) ;
628
634
await this . prebuildUpdater . stopPrebuildInstance ( ctx , info . latestInstance ) ;
629
635
}
You can’t perform that action at this time.
0 commit comments