diff --git a/src/compose/service-manager.ts b/src/compose/service-manager.ts index a8211f69..c86e45ea 100644 --- a/src/compose/service-manager.ts +++ b/src/compose/service-manager.ts @@ -226,6 +226,15 @@ export class ServiceManager extends (EventEmitter as { } } } + public getAllByAppId(appId: number) { + return this.getAll(`app-id=${appId}`); + } + + public async stopAllByAppId(appId: number) { + for (const app of await this.getAllByAppId(appId)) { + await this.kill(app, { removeContainer: false }); + } + } public async create(service: Service) { const mockContainerId = this.config.newUniqueKey();