From adfd8447a5424f2840e14b3afb1196182878a2ed Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Tue, 28 Jan 2020 20:25:53 -0500 Subject: document why not to use config provider --- apps/thulani_bot/lib/thulani/bot/application.ex | 7 ++++++- apps/thulani_bot/lib/thulani/bot/config.ex | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/thulani_bot/lib/thulani/bot/application.ex b/apps/thulani_bot/lib/thulani/bot/application.ex index 8ab6e90..7507eb8 100644 --- a/apps/thulani_bot/lib/thulani/bot/application.ex +++ b/apps/thulani_bot/lib/thulani/bot/application.ex @@ -2,9 +2,14 @@ defmodule Thulani.Bot.Application do alias Thulani.Bot.Config use Application + @applications [ + :nostrum + ] + def start(_type, _args) do Config.init!() - Application.start(:nostrum) + + Enum.each(@applications, fn a -> Application.start(a) end) children = [] diff --git a/apps/thulani_bot/lib/thulani/bot/config.ex b/apps/thulani_bot/lib/thulani/bot/config.ex index d93e8d1..e57dbe2 100644 --- a/apps/thulani_bot/lib/thulani/bot/config.ex +++ b/apps/thulani_bot/lib/thulani/bot/config.ex @@ -1,4 +1,9 @@ defmodule Thulani.Bot.Config do + # note: we actively don't want to use a config provider, since it only works in a release. + # we want to be able to *always* assume the config is going to be found in the environment and parse it + # ourselves. kind of sucks that we have to start all the applications we want to run ourselves, but that's just + # the way it has to be. + @env_vars %{ database_url: nil, spreadsheet_id: nil, -- cgit v1.3.1