fix(sessds): Return peername of the disconnected client in the REST

This commit is contained in:
ieQu1 2024-03-14 17:34:40 +01:00
parent b6cc9177a6
commit a93f747afa
2 changed files with 10 additions and 2 deletions

View File

@ -1181,14 +1181,21 @@ format_persistent_session_info(ClientId, PSInfo0) ->
Metadata = maps:get(metadata, PSInfo0, #{}),
PSInfo1 = maps:with([created_at, expiry_interval], Metadata),
CreatedAt = maps:get(created_at, PSInfo1),
case Metadata of
#{peername := PeerName} ->
{IpAddress, Port} = peername_dispart(PeerName);
_ ->
IpAddress = undefined,
Port = undefined
end,
PSInfo2 = convert_expiry_interval_unit(PSInfo1),
PSInfo3 = PSInfo2#{
clientid => ClientId,
connected => false,
connected_at => CreatedAt,
ip_address => undefined,
ip_address => IpAddress,
is_persistent => true,
port => undefined
port => Port
},
PSInfo = lists:foldl(
fun result_format_time_fun/2,

View File

@ -0,0 +1 @@
Keep IP and port of the durable client sessions in the database.