diff --git a/bandit.exs b/bandit.exs index b211e9e..d6a3aa9 100644 --- a/bandit.exs +++ b/bandit.exs @@ -21,8 +21,4 @@ bandit = {Bandit, plug: Router, scheme: :http, port: 4000} require Logger Logger.info("starting #{inspect(bandit)}") {:ok, _} = Supervisor.start_link([bandit], strategy: :one_for_one) - -# unless running from IEx, sleep idenfinitely so we can serve requests -unless IEx.started?() do - Process.sleep(:infinity) -end +System.no_halt(true) diff --git a/exshome.exs b/exshome.exs index 90bf495..f786778 100644 --- a/exshome.exs +++ b/exshome.exs @@ -33,7 +33,7 @@ Application.put_all_env( Calendar.put_time_zone_database(Tz.TimeZoneDatabase) -System.no_halt(true) Mix.install([{:exshome, "0.1.7"}]) {:ok, _} = Application.ensure_all_started(:exshome) +System.no_halt(true) diff --git a/gen_stage.exs b/gen_stage.exs index 9705751..92f361e 100644 --- a/gen_stage.exs +++ b/gen_stage.exs @@ -56,8 +56,4 @@ defmodule Main do end Main.main() - -# Unless running from IEx, sleep indefinitely so stages keep running -unless IEx.started?() do - Process.sleep(:infinity) -end +System.no_halt(true) diff --git a/phoenix.exs b/phoenix.exs index f8b513c..c0b0d6b 100644 --- a/phoenix.exs +++ b/phoenix.exs @@ -45,4 +45,4 @@ defmodule SamplePhoenix.Endpoint do end {:ok, _} = Supervisor.start_link([SamplePhoenix.Endpoint], strategy: :one_for_one) -Process.sleep(:infinity) +System.no_halt(true) diff --git a/phoenix_live_view.exs b/phoenix_live_view.exs index 9c78dee..d0add90 100644 --- a/phoenix_live_view.exs +++ b/phoenix_live_view.exs @@ -81,4 +81,4 @@ defmodule SamplePhoenix.Endpoint do end {:ok, _} = Supervisor.start_link([SamplePhoenix.Endpoint], strategy: :one_for_one) -Process.sleep(:infinity) +System.no_halt(true) diff --git a/plug_cowboy.exs b/plug_cowboy.exs index 24fa7f2..a731477 100644 --- a/plug_cowboy.exs +++ b/plug_cowboy.exs @@ -21,8 +21,4 @@ plug_cowboy = {Plug.Cowboy, plug: Router, scheme: :http, port: 4000} require Logger Logger.info("starting #{inspect(plug_cowboy)}") {:ok, _} = Supervisor.start_link([plug_cowboy], strategy: :one_for_one) - -# unless running from IEx, sleep idenfinitely so we can serve requests -unless IEx.started?() do - Process.sleep(:infinity) -end +System.no_halt(true) diff --git a/scenic.exs b/scenic.exs index 576363f..9aa7587 100644 --- a/scenic.exs +++ b/scenic.exs @@ -26,11 +26,6 @@ defmodule Main do ] {:ok, _} = Supervisor.start_link(children, strategy: :one_for_one) - - # unless running from IEx, sleep idenfinitely so the GUI keeps running - unless IEx.started?() do - Process.sleep(:infinity) - end end end @@ -74,3 +69,4 @@ defmodule Example.Scene.Home do end Main.main() +System.no_halt(true)