Skip to content

Commit

Permalink
fix: fix http dont throw errors now
Browse files Browse the repository at this point in the history
  • Loading branch information
Deivu committed Dec 22, 2024
1 parent e119b4c commit 7e131c7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/concurrency/ConcurrencyServer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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 +105,8 @@ export class ConcurrencyServer {
* Starts this server
*/
public start(): Promise<AddressInfo> {
return new Promise((resolve, reject) => {
this.server.listen();
this.server.once('listening', () => resolve(this.info))
this.server.once('error', reject)
return new Promise((resolve) => {
this.server.listen(0 , () => resolve(this.info));
})
}
}

0 comments on commit 7e131c7

Please sign in to comment.