Skip to content

Commit

Permalink
Added reload for RPCConnections section from config
Browse files Browse the repository at this point in the history
  • Loading branch information
Trial97 authored and danbogos committed Mar 25, 2020
1 parent f2c8f2b commit 7a746a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions servmanager/servmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 7a746a2

Please sign in to comment.