Created
September 16, 2017 20:44
-
-
Save coline-carle/2c46488f61a9bf4ca8cc319af2aae030 to your computer and use it in GitHub Desktop.
This file contains 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
defmodule ArmoryCrawler.CharacterSupervisor do | |
use Supervisor | |
def start_link(_) do | |
{:ok, supervisor} = Supervisor.start_link(__MODULE__, [], name: __MODULE__) | |
case ArmoryCrawler.env() do | |
:prod -> | |
Supervisor.start_child(__MODULE__, ["eu"]) | |
Supervisor.start_child(__MODULE__, ["us"]) | |
Supervisor.start_child(__MODULE__, ["kr"]) | |
Supervisor.start_child(__MODULE__, ["tw"]) | |
_ -> | |
Supervisor.start_child(__MODULE__, ["eu"]) | |
end | |
{:ok, supervisor} | |
end | |
def init(_arg) do | |
Supervisor.init([{ArmoryCrawler.Character, :dynamic}], strategy: :simple_one_for_one) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment