From fadfacaf2d080498c1355be11db6fb217abf470f Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 26 Jan 2023 13:46:21 -0600 Subject: [PATCH] add clustering --- config/runtime.exs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/config/runtime.exs b/config/runtime.exs index 2cdfa3c..241a7df 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -71,6 +71,23 @@ if config_env() == :prod do aprs_is_login_id: System.get_env("APRS_CALLSIGN"), aprs_is_password: System.get_env("APRS_PASSCODE") + app_name = + System.get_env("FLY_APP_NAME") || + raise "FLY_APP_NAME not available" + + config :libcluster, + debug: true, + topologies: [ + fly6pn: [ + strategy: Cluster.Strategy.DNSPoll, + config: [ + polling_interval: 5_000, + query: "#{app_name}.internal", + node_basename: app_name + ] + ] + ] + # ## SSL Support # # To get SSL working, you will need to add the `https` key