Skip to content

Commit

Permalink
fix(microservices): close underlying server once if already terminated
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Aug 16, 2022
1 parent 3fa8600 commit 394de89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/microservices/nest-microservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 394de89

Please sign in to comment.