From 159b9236980a549efcecddbb2289225564f465a1 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Wed, 19 Feb 2025 11:53:10 +0800 Subject: [PATCH] fix format --- apps/iot/src/iot_host_mapper.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/iot/src/iot_host_mapper.erl b/apps/iot/src/iot_host_mapper.erl index ec91456..c6b3b97 100644 --- a/apps/iot/src/iot_host_mapper.erl +++ b/apps/iot/src/iot_host_mapper.erl @@ -78,7 +78,10 @@ handle_cast({ips, HostUUID, Ips}, State = #state{mapper = Mapper}) -> false -> %% 写入到文件 Items = maps:to_list(NMapper), - Lines = lists:map(fun({HostUUID0, Ips0}) -> iolist_to_binary([HostUUID0, <<"\t">>, Ips0]) end, Items), + Lines = lists:map(fun({HostUUID0, Ips0}) -> + BinIps = iolist_to_binary(lists:join(<<", ">>, Ips0)), + iolist_to_binary([HostUUID0, <<"\t">>, BinIps]) + end, Items), Content = iolist_to_binary(lists:join(<<"\n">>, Lines)), Filename = code:root_dir() ++ "/log/host_mapper.txt", ok = file:write_file(Filename, Content, [write]),