fix(gw): compatible with the max_connection is string type
This commit is contained in:
parent
77d4faa632
commit
78dd9fe247
|
@ -90,7 +90,6 @@ fields(sentinel) ->
|
|||
}},
|
||||
{sentinel, #{
|
||||
type => string(),
|
||||
required => true,
|
||||
desc => ?DESC("sentinel_desc")
|
||||
}}
|
||||
] ++
|
||||
|
|
|
@ -304,7 +304,8 @@ do_listeners_cluster_status(Listeners) ->
|
|||
Id => #{
|
||||
node => Node,
|
||||
current_connections => Curr,
|
||||
max_connections => Max
|
||||
%% XXX: Since it is taken from raw-conf, it is possible a string
|
||||
max_connections => int(Max)
|
||||
}
|
||||
}
|
||||
end,
|
||||
|
@ -312,6 +313,11 @@ do_listeners_cluster_status(Listeners) ->
|
|||
Listeners
|
||||
).
|
||||
|
||||
int(B) when is_binary(B) ->
|
||||
binary_to_integer(B);
|
||||
int(I) when is_integer(I) ->
|
||||
I.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Swagger defines
|
||||
%%--------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue