Skip to content

Commit 6689032

Browse files
committed
fix: wait a bit before bringing down the project node
1 parent 0c44085 commit 6689032

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/expert/lib/expert/engine_node.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ defmodule Expert.EngineNode do
5858
end
5959

6060
def stop(%__MODULE__{} = state, from, stop_timeout) do
61-
project_rpc(state, System, :stop)
61+
# Wait a little bit before stopping the node to allow the reply
62+
# to be sent back to the caller before the node goes down.
63+
:timer.apply_after(50, fn ->
64+
project_rpc(state, System, :stop)
65+
end)
6266
%{state | stopped_by: from, stop_timeout: stop_timeout, status: :stopping}
6367
end
6468

0 commit comments

Comments
 (0)