mirror of
https://github.com/valitydev/dominant.git
synced 2024-11-06 02:25:17 +00:00
MSPF-91: fixed startup termination due to failed healthcheck (#12)
This commit is contained in:
parent
7427f8d44e
commit
db64a67215
@ -116,9 +116,7 @@ apply_commit(VersionWas, #'Commit'{ops = Ops}, History) ->
|
||||
-spec start(application:start_type(), term()) -> {ok, pid()} | {error, term()}.
|
||||
|
||||
start(_StartType, _Args) ->
|
||||
{ok, Pid} = supervisor:start_link({local, ?MODULE}, ?MODULE, []),
|
||||
{ok, _Context} = dmt_api_mg:start(dmt_api_context:new()),
|
||||
{ok, Pid}.
|
||||
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||
|
||||
-spec stop(term()) -> ok.
|
||||
|
||||
|
@ -72,7 +72,13 @@ commit(Version, Commit, Context) ->
|
||||
call(Method, Args, Context) ->
|
||||
Request = {{dmsl_state_processing_thrift, 'Automaton'}, Method, [?NS | Args]},
|
||||
{ok, URL} = application:get_env(dmt_api, automaton_service_url),
|
||||
woody_client:call(Context, Request, #{url => URL}).
|
||||
try
|
||||
woody_client:call(Context, Request, #{url => URL})
|
||||
catch
|
||||
throw:{{exception, #'MachineNotFound'{}}, Context1} ->
|
||||
{ok, Context2} = start(Context1),
|
||||
woody_client:call(Context2, Request, #{url => URL})
|
||||
end.
|
||||
|
||||
%% utils
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user