diff options
| author | Nathan Perry <np@nathanperry.dev> | 2020-01-28 20:25:53 -0500 |
|---|---|---|
| committer | Nathan Perry <np@nathanperry.dev> | 2020-01-28 20:25:53 -0500 |
| commit | adfd8447a5424f2840e14b3afb1196182878a2ed (patch) | |
| tree | 095c116aa47b4870cb42d5cd3cd150b07cb3a2df | |
| parent | 425c63a31e424b9abe4c0f99c009c32b75e2fbc8 (diff) | |
document why not to use config provider
| -rw-r--r-- | apps/thulani_bot/lib/thulani/bot/application.ex | 7 | ||||
| -rw-r--r-- | apps/thulani_bot/lib/thulani/bot/config.ex | 5 |
2 files changed, 11 insertions, 1 deletions
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, |
