mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Remove getConnWithConfig unused parameter
This commit is contained in:
committed by
Dan Christian Bogos
parent
b580e09a00
commit
8dc3a9e28f
@@ -96,7 +96,7 @@ func (cM *ConnManager) getConn(ctx *context.Context, connID string) (conn birpc.
|
||||
}
|
||||
}
|
||||
}
|
||||
if conn, err = cM.getConnWithConfig(ctx, connID, connCfg, intChan, isInternalRPC); err != nil {
|
||||
if conn, err = cM.getConnWithConfig(ctx, connID, connCfg, intChan); err != nil {
|
||||
return
|
||||
}
|
||||
err = Cache.Set(utils.CacheRPCConnections, connID, conn, nil,
|
||||
@@ -105,7 +105,7 @@ func (cM *ConnManager) getConn(ctx *context.Context, connID string) (conn birpc.
|
||||
}
|
||||
|
||||
func (cM *ConnManager) getConnWithConfig(ctx *context.Context, connID string, connCfg *config.RPCConn,
|
||||
intChan chan birpc.ClientConnector, isInternalRPC bool) (conn birpc.ClientConnector, err error) {
|
||||
intChan chan birpc.ClientConnector) (conn birpc.ClientConnector, err error) {
|
||||
if connCfg.Strategy == rpcclient.PoolParallel {
|
||||
rpcConnCfg := connCfg.Conns[0] // for parallel we need only the first connection
|
||||
codec := rpcclient.GOBrpc
|
||||
@@ -219,7 +219,7 @@ func (cM *ConnManager) CallWithConnIDs(connIDs []string, subsHostIDs utils.Strin
|
||||
// skip this pool if no connection matches
|
||||
continue
|
||||
}
|
||||
if conn, err = cM.getConnWithConfig(context.TODO(), connID, newCfg, nil, false); err != nil {
|
||||
if conn, err = cM.getConnWithConfig(context.TODO(), connID, newCfg, nil); err != nil {
|
||||
continue
|
||||
}
|
||||
if err = conn.Call(context.TODO(), method, arg, reply); !rpcclient.IsNetworkError(err) {
|
||||
|
||||
@@ -166,7 +166,7 @@ func TestCMgetConnWithConfigUnsupportedTransport(t *testing.T) {
|
||||
}
|
||||
|
||||
experr := fmt.Sprintf("Unsupported transport: <%+s>", "invalid")
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc, true)
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc)
|
||||
|
||||
if err == nil || err.Error() != experr {
|
||||
t.Fatalf("expected: <%+v>, \nreceived: <%+v>", experr, err)
|
||||
@@ -201,7 +201,7 @@ func TestCMgetConnWithConfigUnsupportedCodec(t *testing.T) {
|
||||
|
||||
experr := rpcclient.ErrUnsupportedCodec
|
||||
var exp *rpcclient.RPCParallelClientPool
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc, true)
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc)
|
||||
|
||||
if err == nil || err != experr {
|
||||
t.Fatalf("expected: <%+v>, \nreceived: <%+v>", experr, err)
|
||||
@@ -236,7 +236,7 @@ func TestCMgetConnWithConfigEmptyTransport(t *testing.T) {
|
||||
|
||||
cM.connCache.Set(connID, nil, nil)
|
||||
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc, true)
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("expected: <%+v>, \nreceived: <%+v>", nil, err)
|
||||
@@ -276,7 +276,7 @@ func TestCMgetConnWithConfigInternalRPCCodec(t *testing.T) {
|
||||
connCache: ltcache.NewCache(-1, 0, true, nil),
|
||||
}
|
||||
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc, true)
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("expected: <%+v>, \nreceived: <%+v>", nil, err)
|
||||
@@ -309,7 +309,7 @@ func TestCMgetConnWithConfigInternalBiRPCCodecUnsupported(t *testing.T) {
|
||||
}
|
||||
|
||||
experr := rpcclient.ErrUnsupportedCodec
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc, true)
|
||||
rcv, err := cM.getConnWithConfig(context.Background(), connID, cfg.RPCConns()[connID], cc)
|
||||
|
||||
if err == nil || err != experr {
|
||||
t.Fatalf("expected: <%+v>, \nreceived: <%+v>", experr, err)
|
||||
|
||||
Reference in New Issue
Block a user