diff --git a/CHANGELOG.md b/CHANGELOG.md index cf77dd58fd..02d1deea44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Fixes - [#5416](https://github.com/blockscout/blockscout/pull/5416) - Fix getsourcecode for EOA addresses +- [#5410](https://github.com/blockscout/blockscout/pull/5410) - Handle exited realtime fetcher - [#5383](https://github.com/blockscout/blockscout/pull/5383) - Fix reload transactions button - [#5381](https://github.com/blockscout/blockscout/pull/5381), [#5397](https://github.com/blockscout/blockscout/pull/5397) - Fix exchange rate broadcast error - [#5375](https://github.com/blockscout/blockscout/pull/5375) - Fix pending transactions fetcher diff --git a/apps/indexer/lib/indexer/block/realtime/fetcher.ex b/apps/indexer/lib/indexer/block/realtime/fetcher.ex index 2b96f6ffe3..4529a76134 100644 --- a/apps/indexer/lib/indexer/block/realtime/fetcher.ex +++ b/apps/indexer/lib/indexer/block/realtime/fetcher.ex @@ -155,6 +155,14 @@ defmodule Indexer.Block.Realtime.Fetcher do Logger.debug(fn -> ["Could not connect to websocket: #{inspect(reason)}. Continuing with polling."] end) state end + catch + :exit, _reason -> + if Map.get(state, :timer) && state.timer do + Process.cancel_timer(state.timer) + end + + timer = schedule_polling() + %{state | timer: timer} end defp subscribe_to_new_heads(state, _), do: state