Skip to content

Commit

Permalink
Merge pull request #10122 from nestjs/fix/10120-multiple-close-calls
Browse files Browse the repository at this point in the history
fix(microservices): close underlying server once if already terminated
  • Loading branch information
kamilmysliwiec authored Aug 16, 2022
2 parents 692f399 + 394de89 commit e7efd1e
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 e7efd1e

Please sign in to comment.