From 3f15398c47e58d5a08433041fe287d838f4bce9c Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Sat, 28 Feb 2026 23:49:56 +0800 Subject: [PATCH] fix channel --- apps/sdlan/src/policy/maxwell_redis_channel.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/sdlan/src/policy/maxwell_redis_channel.erl b/apps/sdlan/src/policy/maxwell_redis_channel.erl index 87bf5b5..00ce208 100644 --- a/apps/sdlan/src/policy/maxwell_redis_channel.erl +++ b/apps/sdlan/src/policy/maxwell_redis_channel.erl @@ -36,7 +36,6 @@ loop(State=#state{socket = Socket, command = Command = #command{data = Data}}) - inet:setopts(Socket, [{active, once}]), receive {tcp, _, Packet} -> - logger:debug("channel rec: ~p", [Packet]), NData = <>, case parse(Command#command{data = NData}) of {ok, #command{args = Args}} -> @@ -50,6 +49,7 @@ loop(State=#state{socket = Socket, command = Command = #command{data = Data}}) - {tcp_error, _} -> exit(normal); {tcp_closed, _} -> + logger:debug("[maxwell_redis_channel] channel closed"), exit(normal) end. @@ -67,7 +67,6 @@ handle_command([<<"PUBLISH">>, _Channel, Msg]) -> {reply, encode(1)}; handle_command(Args) -> - logger:debug("[maxwell_redis_channel] args: ~p", [Args]), {reply, encode({error, <<"Unsuported Command">>})}. handle_data(#{<<"database">> := <<"punchnet_v2">>, <<"table">> := <<"identity_policy">>, <<"type">> := <<"insert">>, <<"data">> := Data}) ->