Implement the failover mechanish to ConnManager

This commit is contained in:
TeoV
2019-12-12 13:26:00 +02:00
parent 041320644e
commit bb2845ebda
3 changed files with 8 additions and 2 deletions

View File

@@ -95,7 +95,11 @@ func (cM *ConnManager) Call(connIDs []string, biRPCClient rpcclient.ClientConnec
if conn, err = cM.getConn(connID, biRPCClient); err != nil {
continue
}
return conn.Call(method, arg, reply)
if err = conn.Call(method, arg, reply); rpcclient.IsNetworkError(err) {
continue
} else {
return
}
}
return
}

2
go.mod
View File

@@ -20,7 +20,7 @@ require (
github.com/cgrates/kamevapi v0.0.0-20191001125829-7dbc3ad58817
github.com/cgrates/ltcache v0.0.0-20181016092649-92fb7fa77cca
github.com/cgrates/radigo v0.0.0-20181207143118-e5c8f3272ccc
github.com/cgrates/rpcclient v0.0.0-20191209100218-70f91dc30ac6
github.com/cgrates/rpcclient v0.0.0-20191212101551-ff9c136f66a7
github.com/creack/pty v1.1.7
github.com/fiorix/go-diameter v3.0.3-0.20190716165154-f4823472d0e0+incompatible
github.com/fortytw2/leaktest v1.3.0 // indirect

2
go.sum
View File

@@ -71,6 +71,8 @@ github.com/cgrates/rpcclient v0.0.0-20191115092211-732f09b356e3 h1:Hr038ZfPZz87O
github.com/cgrates/rpcclient v0.0.0-20191115092211-732f09b356e3/go.mod h1:Jy5Lv0y57OlxlNATKrkyAxgftYLHqXuxONgd4qsAC1U=
github.com/cgrates/rpcclient v0.0.0-20191209100218-70f91dc30ac6 h1:g1LZmbYvqYkGAxM4/bNfTcBooCFf0lK2mgrp3yZERL0=
github.com/cgrates/rpcclient v0.0.0-20191209100218-70f91dc30ac6/go.mod h1:xXLqAKVvcdWeDYwHJYwDgAI3ZOg5LZYxzb72kLjsLZU=
github.com/cgrates/rpcclient v0.0.0-20191212101551-ff9c136f66a7 h1:szJPaMz/49gP0X6M1DhjhImDP3rLN8ul7rio2tzorNc=
github.com/cgrates/rpcclient v0.0.0-20191212101551-ff9c136f66a7/go.mod h1:xXLqAKVvcdWeDYwHJYwDgAI3ZOg5LZYxzb72kLjsLZU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=