Add DATABASE_QUEUE_TARGET env

pull/8991/head
Viktor Baranov 12 months ago
parent 1d91e30308
commit 294caa9946
  1. 2
      CHANGELOG.md
  2. 11
      config/runtime/dev.exs
  3. 10
      config/runtime/prod.exs
  4. 1
      docker-compose/envs/common-blockscout.env

@ -8,6 +8,8 @@
### Chore
- [#8991](https://github.com/blockscout/blockscout/pull/8991) - Manage DB queue target via runtime env var
<details>
<summary>Dependencies version bumps</summary>
</details>

@ -42,12 +42,15 @@ pool_size =
do: ConfigHelper.parse_integer_env_var("POOL_SIZE", 30),
else: ConfigHelper.parse_integer_env_var("POOL_SIZE", 40)
queue_target = ConfigHelper.parse_integer_env_var("DATABASE_QUEUE_TARGET", 50)
# Configure your database
config :explorer, Explorer.Repo,
database: database,
hostname: hostname,
url: System.get_env("DATABASE_URL"),
pool_size: pool_size
pool_size: pool_size,
queue_target: queue_target
database_api = if System.get_env("DATABASE_READ_ONLY_API_URL"), do: nil, else: database
hostname_api = if System.get_env("DATABASE_READ_ONLY_API_URL"), do: nil, else: hostname
@ -57,7 +60,8 @@ config :explorer, Explorer.Repo.Replica1,
database: database_api,
hostname: hostname_api,
url: ExplorerConfigHelper.get_api_db_url(),
pool_size: ConfigHelper.parse_integer_env_var("POOL_SIZE_API", 10)
pool_size: ConfigHelper.parse_integer_env_var("POOL_SIZE_API", 10),
queue_target: queue_target
database_account = if System.get_env("ACCOUNT_DATABASE_URL"), do: nil, else: database
hostname_account = if System.get_env("ACCOUNT_DATABASE_URL"), do: nil, else: hostname
@ -67,7 +71,8 @@ config :explorer, Explorer.Repo.Account,
database: database_account,
hostname: hostname_account,
url: ExplorerConfigHelper.get_account_db_url(),
pool_size: ConfigHelper.parse_integer_env_var("ACCOUNT_POOL_SIZE", 10)
pool_size: ConfigHelper.parse_integer_env_var("ACCOUNT_POOL_SIZE", 10),
queue_target: queue_target
# Configure PolygonEdge database
config :explorer, Explorer.Repo.PolygonEdge,

@ -28,24 +28,28 @@ config :block_scout_web, BlockScoutWeb.Endpoint,
################
pool_size = ConfigHelper.parse_integer_env_var("POOL_SIZE", 50)
queue_target = ConfigHelper.parse_integer_env_var("DATABASE_QUEUE_TARGET", 50)
# Configures the database
config :explorer, Explorer.Repo,
url: System.get_env("DATABASE_URL"),
pool_size: pool_size,
ssl: ExplorerConfigHelper.ssl_enabled?()
ssl: ExplorerConfigHelper.ssl_enabled?(),
queue_target: queue_target
# Configures API the database
config :explorer, Explorer.Repo.Replica1,
url: ExplorerConfigHelper.get_api_db_url(),
pool_size: ConfigHelper.parse_integer_env_var("POOL_SIZE_API", 50),
ssl: ExplorerConfigHelper.ssl_enabled?()
ssl: ExplorerConfigHelper.ssl_enabled?(),
queue_target: queue_target
# Configures Account database
config :explorer, Explorer.Repo.Account,
url: ExplorerConfigHelper.get_account_db_url(),
pool_size: ConfigHelper.parse_integer_env_var("ACCOUNT_POOL_SIZE", 50),
ssl: ExplorerConfigHelper.ssl_enabled?()
ssl: ExplorerConfigHelper.ssl_enabled?(),
queue_target: queue_target
# Configures PolygonEdge database
config :explorer, Explorer.Repo.PolygonEdge,

@ -3,6 +3,7 @@ ETHEREUM_JSONRPC_VARIANT=geth
ETHEREUM_JSONRPC_HTTP_URL=http://host.docker.internal:8545/
# ETHEREUM_JSONRPC_FALLBACK_HTTP_URL=
DATABASE_URL=postgresql://blockscout:ceWb1MeLBEeOIfk65gU8EjF8@db:5432/blockscout
# DATABASE_QUEUE_TARGET
ETHEREUM_JSONRPC_TRACE_URL=http://host.docker.internal:8545/
# ETHEREUM_JSONRPC_FALLBACK_TRACE_URL=
# ETHEREUM_JSONRPC_HTTP_TIMEOUT=

Loading…
Cancel
Save