Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 49c428a

Browse files
authored
fix: terminate system should kill cortex process (#955)
1 parent efa55f1 commit 49c428a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cortex-js/src/infrastructure/controllers/system.controller.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ import {
3030
} from 'rxjs';
3131
import { ResourcesManagerService } from '../services/resources-manager/resources-manager.service';
3232
import { ResourceEvent } from '@/domain/models/resource.interface';
33+
import { CortexUsecases } from '@/usecases/cortex/cortex.usecases';
3334

3435
@ApiTags('System')
3536
@Controller('system')
3637
export class SystemController {
3738
constructor(
3839
private readonly downloadManagerService: DownloadManagerService,
3940
private readonly modelsUsecases: ModelsUsecases,
41+
private readonly cortexUsecases: CortexUsecases,
4042
private readonly eventEmitter: EventEmitter2,
4143
private readonly resourcesManagerService: ResourcesManagerService,
4244
) {}
@@ -47,6 +49,7 @@ export class SystemController {
4749
})
4850
@Delete()
4951
async delete() {
52+
await this.cortexUsecases.stopCortex().catch(() => {});
5053
process.exit(0);
5154
}
5255

0 commit comments

Comments
 (0)