is_restarting/1 in ecallmgr_fs_node.erl

17 views
Skip to first unread message

dog

unread,
Jun 16, 2017, 10:18:29 AM6/16/17
to 2600hz-dev
Hi, I've been taking some time to learn about ecallmgr.

In ecallmgr_fs_node.erl, is_restarting/1 uses the 'status' atom and then converts it into seconds. Is there an architectural reason that 'status' is used instead of 'uptime'? 

For example, this is how I'd envision 'uptime' being used:

is_restarting(Node) when is_atom(Node) ->
    case freeswitch:api(Node, 'uptime', <<>>) of
        {'ok', Uptime} ->
            [UP|_] = binary:split(Uptime, <<"\n">>),
            kz_term:to_integer(UP) < ?UPTIME_S;
        _E ->
            lager:debug("failed to get status of node ~s: ~p", [Node, _E]),
            'false'
    end.

I just want to make sure that there wasn't some problem that 2600hz dev had with 'uptime' that would require parsing the output of 'status' instead.
Reply all
Reply to author
Forward
0 new messages