diff --git a/lib/trinity/scheduler/simulation_supervisor.ex b/lib/trinity/scheduler/simulation_supervisor.ex index 0007252..95b6e65 100644 --- a/lib/trinity/scheduler/simulation_supervisor.ex +++ b/lib/trinity/scheduler/simulation_supervisor.ex @@ -36,7 +36,11 @@ defmodule Trinity.Scheduler.SimulationSupervisor do @spec spawn_child(GenServer.server, function) :: pid def spawn_child(server, fun) do - GenServer.call(server, {:spawn_child, fun}) + # This is a bit ridiculous + case server == self() do + true -> spawn_sim_child(%Simulation{} = Process.get(simulation_key()), fun) + false -> GenServer.call(server, {:spawn_child, fun}) + end end def kill_node(server, node) do