Skip to content

Commit

Permalink
speed
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Nov 8, 2023
1 parent 9a2311e commit 280bfc6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion flavours/classic/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,17 @@ end
# start prod and dev only config
if config_env() != :test do
config :bonfire, Bonfire.Common.Repo,
slow_query_ms: String.to_integer(System.get_env("SLOW_QUERY_MS", "100"))
slow_query_ms: String.to_integer(System.get_env("DB_SLOW_QUERY_MS", "100")),
# The timeout for establishing new connections (default: 5000)
connect_timeout: String.to_integer(System.get_env("DB_CONNECT_TIMEOUT", "10000")),
# The time in milliseconds (as an integer) to wait for the query call to finish (default: 15_000)
timeout: String.to_integer(System.get_env("DB_QUERY_TIMEOUT", "20000")),
parameters: [
# Abort any statement that takes more than the specified amount of time. The timeout is measured from the time a command arrives at the server until it is completed by the server.
statement_timeout: System.get_env("DB_STATEMENT_TIMEOUT", "20000"),
# Terminate any session with an open transaction that has been idle for longer than the specified amount of time. This allows any locks held by that session to be released and the connection slot to be reused
idle_in_transaction_session_timeout: System.get_env("DB_IDLE_TRANSACTION_TIMEOUT", "1000")
]
end

## bonfire_livebook
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ defmodule Bonfire.Umbrella.MixProject do
{:mneme, ">= 0.0.0", only: [:dev, :test]},

# Benchmarking utilities
{:benchee, "~> 1.1", only: [:dev, :test]},
{:benchee, "~> 1.1", override: true},
{:benchee_html, "~> 1.0", only: [:dev, :test]},
# for Telemetry store
{:circular_buffer, "~> 0.4", only: :dev},
Expand Down

0 comments on commit 280bfc6

Please sign in to comment.