diff --git a/apps/lenra_web/lib/lenra_web/controllers/runner_controller.ex b/apps/lenra_web/lib/lenra_web/controllers/runner_controller.ex index 95d49e73..0e8f329a 100644 --- a/apps/lenra_web/lib/lenra_web/controllers/runner_controller.ex +++ b/apps/lenra_web/lib/lenra_web/controllers/runner_controller.ex @@ -21,7 +21,16 @@ defmodule LenraWeb.RunnerController do {:ok, _} <- Apps.update_build(build, %{status: status}), {:ok, _} <- maybe_deploy_in_main_env(build, status) do if String.downcase(Application.fetch_env!(:lenra, :pipeline_runner)) == "kubernetes" do - GenServer.stop({:global, {Kubernetes.Status, build_id}}) + try do + GenServer.stop({:global, {Kubernetes.Status, build_id}}) + catch + :exit, {:noproc, _} -> + Logger.warning( + "Could not stop Kubernetes.Status with build_id : `#{build_id}` because it was already stopped or has crashed." + ) + + :ok + end end reply(conn)