Skip to content

Commit c9093fe

Browse files
committed
perf(container): force remove container instead of graceful stop
1 parent 5ff62b9 commit c9093fe

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/api/docker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export function killContainer(id: string): Promise<void> {
196196
if (containerInfo.State.Status === 'exited') {
197197
return container.remove();
198198
} else if (containerInfo.State.Status === 'running') {
199-
return container.stop().then(c => c.remove());
199+
return container.remove({ force: true });
200200
} else {
201201
return Promise.resolve();
202202
}

src/api/socket.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ export class SocketServer {
230230
break;
231231

232232
case 'subscribeToJobOutput':
233-
const jobId = parseInt(event.data.jobId, 10);
234-
const idx = processes.findIndex(proc => proc.job_id === jobId);
233+
const jobId = Number(event.data.jobId);
234+
const idx = processes.findIndex(proc => Number(proc.job_id) === jobId);
235235
if (idx !== -1) {
236236
const proc = processes[idx];
237237
conn.next({ type: 'data', data: proc.log });

src/app/components/app-job/app-job.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, OnDestroy, NgZone, Inject } from '@angular/core';
1+
import { Component, OnInit, OnDestroy, Inject } from '@angular/core';
22
import { DOCUMENT } from '@angular/common';
33
import { Title } from '@angular/platform-browser';
44
import { ActivatedRoute } from '@angular/router';
@@ -50,7 +50,6 @@ export class AppJobComponent implements OnInit, OnDestroy {
5050
private timeService: TimeService,
5151
private authService: AuthService,
5252
private route: ActivatedRoute,
53-
private ngZone: NgZone,
5453
@Inject(DOCUMENT) private document: any,
5554
private titleService: Title
5655
) {
@@ -70,9 +69,7 @@ export class AppJobComponent implements OnInit, OnDestroy {
7069
this.termSub = this.socketService.outputEvents
7170
.subscribe(event => {
7271
if (event.type === 'data' || event.type === 'exit' || event.type === 'container') {
73-
if (typeof event.data === 'string') {
74-
this.ngZone.run(() => this.terminalInput = event.data);
75-
}
72+
this.terminalInput = event.data;
7673
} else if (event.type === 'job stopped' && event.data === this.id) {
7774
this.processing = false;
7875
} else if (event.type === 'job restarted' && event.data === this.id) {

0 commit comments

Comments
 (0)