Added reload for RPCConnections section from config

This commit is contained in:
Trial97
2020-03-25 12:08:45 +02:00
committed by Dan Christian Bogos
parent 6f8fd34967
commit 12e3b99d49
2 changed files with 4 additions and 0 deletions

View File

@@ -1411,6 +1411,7 @@ func (cfg *CGRConfig) reloadSections(sections ...string) (err error) {
return fmt.Errorf("Invalid section: <%s>", section)
case GENERAL_JSN: // nothing to reload
case RPCConnsJsonName: // nothing to reload
cfg.rldChans[RPCConnsJsonName] <- struct{}{}
case DATADB_JSN: // reloaded before
case STORDB_JSN: // reloaded before
case LISTEN_JSN:

View File

@@ -26,6 +26,7 @@ import (
"sync"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
"github.com/cgrates/rpcclient"
)
@@ -307,6 +308,8 @@ func (srvMngr *ServiceManager) handleReload() {
if err = srvMngr.reloadService(utils.StorDB); err != nil {
return
}
case <-srvMngr.GetConfig().GetReloadChan(config.RPCConnsJsonName):
engine.Cache.Clear([]string{utils.CacheRPCConnections})
}
// handle RPC server
}