2

So basically I need some Ecto repository information (call it "Sample.Repo") to start the repo in a release task for Ecto 3. It's configured in a runtime config with a custom json config provider as described in https://hexdocs.pm/distillery/2.0.0-rc.5/config_providers.html.

When I do something like:

Application.get_env(:my_app, Sample.Repo)

I get back nil.

Is there a way to get the runtime config value in a release task or if not, what is an alternative solution?

Nona
  • 5,302
  • 7
  • 41
  • 79
  • 1
    `Application.get_env` is the correct way, so I would debug if the config provider is actually working as expected. Is it being called? Are you being able to successfully read and parse the JSON? – José Valim Jun 19 '19 at 07:00
  • Thank you @JoséValim..as it turns out, our system config had been updated on the server without my knowing about it, and so I was using the wrong key to get the value (facepalm...) – Nona Jul 19 '19 at 05:56

0 Answers0