Skip to content

Instantly share code, notes, and snippets.

@talentdeficit
Created January 5, 2017 03:50
Show Gist options
  • Save talentdeficit/559f2386a43da841c776a8d7526a347e to your computer and use it in GitHub Desktop.
Save talentdeficit/559f2386a43da841c776a8d7526a347e to your computer and use it in GitHub Desktop.
using a json blob as application config
def reload_config(path_to_config) do
config = File.read!(path_to_config) |> Poison.decode!
Application.put_env(AppA, KeyA, config["key_a"])
Application.put_env(AppB, KeyB, config["key_b"])
Application.stop(AppA)
Application.stop(AppB)
Application.start(AppA)
Application.start(AppB)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment