From fbbf53cd524bb22f6fa6383a2e9ddb8eed743000 Mon Sep 17 00:00:00 2001 From: Qwerty5Uiop Date: Tue, 7 Nov 2023 17:01:17 +0600 Subject: [PATCH] Disable catchup indexer by env --- CHANGELOG.md | 2 ++ apps/indexer/lib/indexer/supervisor.ex | 12 +++++++----- config/runtime.exs | 2 ++ docker-compose/envs/common-blockscout.env | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4163b44323..eafd2ff4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features +- [#8795](https://github.com/blockscout/blockscout/pull/8795) - Disable catchup indexer by env + ### Fixes - [#8765](https://github.com/blockscout/blockscout/pull/8765) - Fix for tvl update in market history when row already exists diff --git a/apps/indexer/lib/indexer/supervisor.ex b/apps/indexer/lib/indexer/supervisor.ex index 5fce739019..c7afebbbce 100644 --- a/apps/indexer/lib/indexer/supervisor.ex +++ b/apps/indexer/lib/indexer/supervisor.ex @@ -157,11 +157,13 @@ defmodule Indexer.Supervisor do %{block_fetcher: realtime_block_fetcher, subscribe_named_arguments: realtime_subscribe_named_arguments}, [name: BlockRealtime.Supervisor] ]), - {BlockCatchup.Supervisor, - [ - %{block_fetcher: block_fetcher, block_interval: block_interval, memory_monitor: memory_monitor}, - [name: BlockCatchup.Supervisor] - ]}, + configure( + BlockCatchup.Supervisor, + [ + %{block_fetcher: block_fetcher, block_interval: block_interval, memory_monitor: memory_monitor}, + [name: BlockCatchup.Supervisor] + ] + ), {Withdrawal.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments]]} ] |> List.flatten() diff --git a/config/runtime.exs b/config/runtime.exs index 3bc5336b44..2b3f4d44fc 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -525,6 +525,8 @@ config :indexer, Indexer.Fetcher.EmptyBlocksSanitizer.Supervisor, config :indexer, Indexer.Block.Realtime.Supervisor, enabled: !ConfigHelper.parse_bool_env_var("DISABLE_REALTIME_INDEXER") +config :indexer, Indexer.Block.Catchup.Supervisor, enabled: !ConfigHelper.parse_bool_env_var("DISABLE_CATCHUP_INDEXER") + config :indexer, Indexer.Fetcher.TokenInstance.Realtime.Supervisor, disabled?: ConfigHelper.parse_bool_env_var("INDEXER_DISABLE_TOKEN_INSTANCE_REALTIME_FETCHER") diff --git a/docker-compose/envs/common-blockscout.env b/docker-compose/envs/common-blockscout.env index 3b5ae9a7d2..7bf3c41a56 100644 --- a/docker-compose/envs/common-blockscout.env +++ b/docker-compose/envs/common-blockscout.env @@ -99,6 +99,7 @@ API_V1_READ_METHODS_DISABLED=false API_V1_WRITE_METHODS_DISABLED=false DISABLE_INDEXER=false DISABLE_REALTIME_INDEXER=false +DISABLE_CATCHUP_INDEXER=false INDEXER_DISABLE_TOKEN_INSTANCE_REALTIME_FETCHER=false INDEXER_DISABLE_TOKEN_INSTANCE_RETRY_FETCHER=false INDEXER_DISABLE_TOKEN_INSTANCE_SANITIZE_FETCHER=false