@@ -31,7 +31,7 @@ ready(#{method := <<"GET">>} = _Req) ->
3131 true ->
3232 {json , #{status => <<" ready" >>}};
3333 false ->
34- {json , #{ status => <<" not_ready" >>}, #{ status => 503 }}
34+ {json , 503 , #{}, #{ status => <<" not_ready" >>}}
3535 end .
3636
3737-doc " Liveness probe. Returns 200 if the process is responsive." .
@@ -49,35 +49,35 @@ build_health_report() ->
4949 Deps = nova_resilience_registry :list (),
5050 DepStatuses = lists :foldl (
5151 fun (#{name := Name } = _Dep , Acc ) ->
52- Status = case nova_resilience_registry :status (Name ) of
53- {ok , S } -> S ;
54- _ -> #{breaker => unknown , bulkhead => unknown }
55- end ,
52+ Status =
53+ case nova_resilience_registry :status (Name ) of
54+ {ok , S } -> S ;
55+ _ -> #{breaker => unknown , bulkhead => unknown }
56+ end ,
5657 DepHealth = dep_health_from_check (Name , HealthResult ),
5758 Acc #{Name => maps :merge (DepHealth , Status )}
5859 end ,
5960 #{},
6061 Deps
6162 ),
62- OverallStatus = case nova_resilience_gate :is_ready () of
63- true -> <<" healthy" >>;
64- false -> <<" unhealthy" >>
65- end ,
63+ OverallStatus =
64+ case nova_resilience_gate :is_ready () of
65+ true -> <<" healthy" >>;
66+ false -> <<" unhealthy" >>
67+ end ,
6668 #{
6769 status => OverallStatus ,
6870 dependencies => DepStatuses ,
6971 vm => vm_info ()
7072 }.
7173
72- dep_health_from_check (Name , { _OverallHealth , Checks }) when is_map ( Checks ) ->
74+ dep_health_from_check (Name , #{ checks : = Checks } ) ->
7375 case maps :get (Name , Checks , undefined ) of
7476 {healthy , Details } -> #{status => <<" healthy" >>, details => Details };
7577 {degraded , Details } -> #{status => <<" degraded" >>, details => Details };
7678 {unhealthy , Details } -> #{status => <<" unhealthy" >>, details => Details };
7779 undefined -> #{status => <<" unknown" >>}
78- end ;
79- dep_health_from_check (_Name , _ ) ->
80- #{status => <<" unknown" >>}.
80+ end .
8181
8282vm_info () ->
8383 #{
0 commit comments