From 5825782ecd566e151ba59d47520c3aab900c5ba6 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 9 Oct 2019 17:13:37 +0300 Subject: [PATCH] make sender configuerable --- apps/explorer/config/config.exs | 6 +++++- docs/env-variables.md | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/explorer/config/config.exs b/apps/explorer/config/config.exs index 97f7391241..39124ba2e0 100644 --- a/apps/explorer/config/config.exs +++ b/apps/explorer/config/config.exs @@ -16,7 +16,11 @@ config :explorer, include_uncles_in_average_block_time: if(System.get_env("UNCLES_IN_AVERAGE_BLOCK_TIME") == "true", do: true, else: false), healthy_blocks_period: System.get_env("HEALTHY_BLOCKS_PERIOD") || :timer.minutes(5), - realtime_events_sender: Explorer.Chain.Events.DBSender + realtime_events_sender: + if(System.get_env("DISABLE_WEBAPP") != "true", + do: Explorer.Chain.Events.SimpleSender, + else: Explorer.Chain.Events.DBSender + ) average_block_period = case Integer.parse(System.get_env("AVERAGE_BLOCK_CACHE_PERIOD", "")) do diff --git a/docs/env-variables.md b/docs/env-variables.md index 88f4cfbc07..0aef06b1ae 100644 --- a/docs/env-variables.md +++ b/docs/env-variables.md @@ -59,7 +59,7 @@ $ export NETWORK=POA | `UNCLES_IN_AVERAGE_BLOCK_TIME` | Include or exclude nonconsensus blocks in avg block time calculation. Exclude if `false`. | false | v2.0.1+ | | | | `AVERAGE_BLOCK_CACHE_PERIOD` | | Update of average block cache, in seconds | 30 minutes | v2.0.2+ | | | `MARKET_HISTORY_CACHE_PERIOD` | | Update of market history cache, in seconds | 6 hours | v2.0.2+ | | -| `DISABLE_WEBAPP` | | If `true`, endpoints to webapp are hidden (compile-time) | `false` | v2.0.3+ | :white_check_mark: | | +| `DISABLE_WEBAPP` | | If `true`, endpoints to webapp are hidden (compile-time). Also, enabling it makes notifications go through `db_notify` | `false` | v2.0.3+ | :white_check_mark: | | | `DISABLE_READ_API` | | If `true`, read-only endpoints to API are hidden (compile-time) | `false` | v2.0.3+ | :white_check_mark: | | | `DISABLE_WRITE_API` | | If `true`, write endpoints to API are hidden (compile-time) | `false` | v2.0.3+ | :white_check_mark: | | | `DISABLE_INDEXER` | | If `true`, indexer application doesn't run | `false` | v2.0.3+ | :white_check_mark: | |