Skip to content

Commit

Permalink
fix: fix start issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Deivu committed Dec 22, 2024
1 parent 116bdca commit e119b4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/concurrency/ConcurrencyServer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AddressInfo } from 'node:net';
import { ConcurrencyManager } from './ConcurrencyManager';
import { once } from 'node:events';
import Http from 'node:http';

/**
Expand Down Expand Up @@ -106,10 +107,9 @@ export class ConcurrencyServer {
*/
public start(): Promise<AddressInfo> {
return new Promise((resolve, reject) => {
this.server.listen((error: Error, addressInfo: AddressInfo) => {
if (error) return reject(error);
resolve(addressInfo);
})
this.server.listen();
this.server.once('listening', () => resolve(this.info))
this.server.once('error', reject)
})
}
}

0 comments on commit e119b4c

Please sign in to comment.