fix(redis): unwrap pipeline queries against redis cluster
This is an additional safety measure in addition to the disabled batching on the bridge level.
This commit is contained in:
parent
26fcaecad7
commit
2ee00b75a7
|
@ -222,6 +222,8 @@ is_unrecoverable_error(Results) when is_list(Results) ->
|
||||||
lists:any(fun is_unrecoverable_error/1, Results);
|
lists:any(fun is_unrecoverable_error/1, Results);
|
||||||
is_unrecoverable_error({error, <<"ERR unknown command ", _/binary>>}) ->
|
is_unrecoverable_error({error, <<"ERR unknown command ", _/binary>>}) ->
|
||||||
true;
|
true;
|
||||||
|
is_unrecoverable_error({error, invalid_cluster_command}) ->
|
||||||
|
true;
|
||||||
is_unrecoverable_error(_) ->
|
is_unrecoverable_error(_) ->
|
||||||
false.
|
false.
|
||||||
|
|
||||||
|
@ -267,7 +269,9 @@ do_cmd(PoolName, cluster, {cmd, Command}) ->
|
||||||
do_cmd(Conn, _Type, {cmd, Command}) ->
|
do_cmd(Conn, _Type, {cmd, Command}) ->
|
||||||
eredis:q(Conn, Command);
|
eredis:q(Conn, Command);
|
||||||
do_cmd(PoolName, cluster, {cmds, Commands}) ->
|
do_cmd(PoolName, cluster, {cmds, Commands}) ->
|
||||||
wrap_qp_result(eredis_cluster:qp(PoolName, Commands));
|
% TODO
|
||||||
|
% Cluster mode is currently incompatible with batching.
|
||||||
|
wrap_qp_result([eredis_cluster:q(PoolName, Command) || Command <- Commands]);
|
||||||
do_cmd(Conn, _Type, {cmds, Commands}) ->
|
do_cmd(Conn, _Type, {cmds, Commands}) ->
|
||||||
wrap_qp_result(eredis:qp(Conn, Commands)).
|
wrap_qp_result(eredis:qp(Conn, Commands)).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue