Skip to content

Commit

Permalink
close socket client instead of subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Oct 26, 2024
1 parent 4326c74 commit f915b77
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/store-sync/src/wiresaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ export function watchLogs({ url, address, fromBlock }: WatchLogsInput): WatchLog
}, 3000);

client.socket.addEventListener("error", (error) => {
debug("socket error", error);
debug("socket error, closing", error);
clearInterval(keepAliveInterval);
subscriber.error({ code: -32603, message: "WebSocket error", data: error });
client.close();
// subscriber.error({ code: -32603, message: "WebSocket error", data: error });
});

client.socket.addEventListener("close", async () => {
Expand Down

0 comments on commit f915b77

Please sign in to comment.