mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
fix(microservices): close underlying server once if already terminated
This commit is contained in:
@@ -166,10 +166,10 @@ export class NestMicroservice
|
||||
}
|
||||
|
||||
protected async dispose(): Promise<void> {
|
||||
await this.server.close();
|
||||
if (this.isTerminated) {
|
||||
return;
|
||||
}
|
||||
await this.server.close();
|
||||
this.socketModule && (await this.socketModule.close());
|
||||
this.microservicesModule && (await this.microservicesModule.close());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user