Skip to content

Commit

Permalink
fix: remove port with other framework (#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 authored Jul 6, 2021
1 parent 621a99a commit 88fec38
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/ws/src/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ export class MidwayWSFramework extends BaseFramework<

this.server = server;

await new Promise<void>(resolve => {
server.listen(this.configurationOptions.port, () => {
this.logger.info(
`WebSocket server port = ${this.configurationOptions.port} start success`
);
resolve();
if (this.configurationOptions.port) {
await new Promise<void>(resolve => {
server.listen(this.configurationOptions.port, () => {
this.logger.info(
`WebSocket server port = ${this.configurationOptions.port} start success`
);
resolve();
});
});
});
}
}

protected async beforeStop(): Promise<void> {
Expand Down

0 comments on commit 88fec38

Please sign in to comment.