mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added reload for RPCConnections section from config
This commit is contained in:
committed by
Dan Christian Bogos
parent
6f8fd34967
commit
12e3b99d49
@@ -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:
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user