Return error is connection to cdr server is nil

This commit is contained in:
TeoV
2018-09-11 10:32:53 -04:00
committed by Dan Christian Bogos
parent 472316ed78
commit bc52d6f08f
5 changed files with 9 additions and 54 deletions

View File

@@ -1088,7 +1088,7 @@ func initLogger(cfg *config.CGRConfig) error {
return nil
}
func createCDRConnection(internalCDRSChan chan rpcclient.RpcClientConnection, exitChan chan bool) {
func schedCDRsConns(internalCDRSChan chan rpcclient.RpcClientConnection, exitChan chan bool) {
var err error
var cdrsConn *rpcclient.RpcClientPool
cdrsConn, err = engine.NewRPCPool(rpcclient.POOL_FIRST, cfg.TLSClientKey, cfg.TLSClientCerificate,
@@ -1263,7 +1263,7 @@ func main() {
// Create connection to CDR Server and share it in engine(used for *cdrlog action)
if len(cfg.SchedulerCfg().CDRsConns) != 0 {
go createCDRConnection(internalCdrSChan, exitChan)
go schedCDRsConns(internalCdrSChan, exitChan)
}
// Start CDR Stats server