From 46011fde7e7de67f1b5967877d25c266a86689a2 Mon Sep 17 00:00:00 2001 From: Kevin Hoffman Date: Tue, 12 Apr 2022 16:27:22 -0400 Subject: [PATCH] Terminate gracefully during SIGTERM (#379) Signed-off-by: Kevin Hoffman --- host_core/lib/host_core/host.ex | 2 ++ host_core/mix.exs | 2 +- wasmcloud_host/mix.exs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/host_core/lib/host_core/host.ex b/host_core/lib/host_core/host.ex index 396eaddf..c2384293 100644 --- a/host_core/lib/host_core/host.ex +++ b/host_core/lib/host_core/host.ex @@ -175,7 +175,9 @@ defmodule HostCore.Host do def terminate(reason, state) do Logger.debug("Host termination requested: #{inspect(reason)}", reason: reason) publish_host_stopped(state.labels) + purge() :timer.sleep(300) + :init.stop() end defp get_env_host_labels() do diff --git a/host_core/mix.exs b/host_core/mix.exs index 91dc95f7..bbfce6c3 100644 --- a/host_core/mix.exs +++ b/host_core/mix.exs @@ -1,7 +1,7 @@ defmodule HostCore.MixProject do use Mix.Project - @app_vsn "0.54.1" + @app_vsn "0.54.2" def project do [ diff --git a/wasmcloud_host/mix.exs b/wasmcloud_host/mix.exs index e8bf6e4e..625ff172 100644 --- a/wasmcloud_host/mix.exs +++ b/wasmcloud_host/mix.exs @@ -1,7 +1,7 @@ defmodule WasmcloudHost.MixProject do use Mix.Project - @app_vsn "0.54.1" + @app_vsn "0.54.2" def project do [