Skip to content

Commit

Permalink
chore: remove redundant eventstream error listener (#5798)
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored Jul 24, 2023
1 parent 7b5fc63 commit 0563661
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, eventTypes} from "../routes/events.js";
import {ApiError, ServerRoutes} from "../../utils/server/index.js";
import {ServerApi} from "../../interfaces.js";
Expand Down Expand Up @@ -57,12 +56,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 0563661

Please sign in to comment.