Skip to content

Commit

Permalink
chore: remove redundant eventstream error listener
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Jul 24, 2023
1 parent 7f19831 commit ec0a60f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions packages/api/src/beacon/server/events.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {ChainForkConfig} from "@lodestar/config";
import {ErrorAborted} from "@lodestar/utils";
import {Api, ReqTypes, routesData, getEventSerdes} from "../routes/events.js";
import {ServerRoutes} from "../../utils/server/index.js";
import {ServerApi} from "../../interfaces.js";
Expand Down Expand Up @@ -50,12 +49,6 @@ export function getRoutes(config: ChainForkConfig, api: ServerApi<Api>): ServerR
// The client may disconnect and we need to clean the subscriptions.
req.socket.once("close", () => resolve());
req.socket.once("end", () => resolve());
req.raw.once("error", (err) => {
if ((err as unknown as {code: string}).code === "ECONNRESET") {
return reject(new ErrorAborted());
}
return reject(err);
});
});

// api.eventstream will never stop, so no need to ever call `res.raw.end();`
Expand Down

0 comments on commit ec0a60f

Please sign in to comment.