fix channel
This commit is contained in:
parent
2a7b8da245
commit
3f15398c47
@ -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 = <<Data/binary, Packet/binary>>,
|
||||
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}) ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user