From b646652071ca2c4da581540ab3d20c00ace989fc Mon Sep 17 00:00:00 2001 From: ruslandoga Date: Wed, 5 Apr 2023 16:58:55 +0700 Subject: [PATCH] add transport opts to clickhouse repos (#2783) --- config/runtime.exs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/runtime.exs b/config/runtime.exs index 75e0a014c..3151029a4 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -279,17 +279,24 @@ config :plausible, :google, reporting_api_url: "https://analyticsreporting.googleapis.com", max_buffer_size: get_int_from_path_or_env(config_dir, "GOOGLE_MAX_BUFFER_SIZE", 10_000) +ch_transport_opts = [ + keepalive: true, + show_econnreset: true +] + config :plausible, Plausible.ClickhouseRepo, loggers: [Ecto.LogEntry], queue_target: 500, queue_interval: 2000, - url: ch_db_url + url: ch_db_url, + transport_opts: ch_transport_opts config :plausible, Plausible.IngestRepo, loggers: [Ecto.LogEntry], queue_target: 500, queue_interval: 2000, url: ch_db_url, + transport_opts: ch_transport_opts, flush_interval_ms: ch_flush_interval_ms, max_buffer_size: ch_max_buffer_size, pool_size: ingest_pool_size @@ -299,6 +306,7 @@ config :plausible, Plausible.AsyncInsertRepo, queue_target: 500, queue_interval: 2000, url: ch_db_url, + transport_opts: ch_transport_opts, pool_size: 1, settings: [ async_insert: 1,