From b65ca83516af7c5642f572a993b872cb29dafff1 Mon Sep 17 00:00:00 2001 From: Louis Le Date: Thu, 1 Aug 2024 10:45:45 +0700 Subject: [PATCH] fix: terminate system should kill cortex process --- cortex-js/src/infrastructure/controllers/system.controller.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cortex-js/src/infrastructure/controllers/system.controller.ts b/cortex-js/src/infrastructure/controllers/system.controller.ts index da16ae38c..b6a52ff20 100644 --- a/cortex-js/src/infrastructure/controllers/system.controller.ts +++ b/cortex-js/src/infrastructure/controllers/system.controller.ts @@ -30,6 +30,7 @@ import { } from 'rxjs'; import { ResourcesManagerService } from '../services/resources-manager/resources-manager.service'; import { ResourceEvent } from '@/domain/models/resource.interface'; +import { CortexUsecases } from '@/usecases/cortex/cortex.usecases'; @ApiTags('System') @Controller('system') @@ -37,6 +38,7 @@ export class SystemController { constructor( private readonly downloadManagerService: DownloadManagerService, private readonly modelsUsecases: ModelsUsecases, + private readonly cortexUsecases: CortexUsecases, private readonly eventEmitter: EventEmitter2, private readonly resourcesManagerService: ResourcesManagerService, ) {} @@ -47,6 +49,7 @@ export class SystemController { }) @Delete() async delete() { + await this.cortexUsecases.stopCortex().catch(() => {}); process.exit(0); }