Created
January 5, 2017 03:50
-
-
Save talentdeficit/559f2386a43da841c776a8d7526a347e to your computer and use it in GitHub Desktop.
using a json blob as application config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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