mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-19 22:28:45 +05:00
Clean up DispatcherS
This commit is contained in:
committed by
Dan Christian Bogos
parent
e23759b4a8
commit
7db65ca62c
@@ -771,30 +771,6 @@ func testConsoleItCacheStats(t *testing.T) {
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*dispatcher_filter_indexes": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*dispatcher_hosts": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*dispatcher_loads": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*dispatcher_profiles": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*dispatcher_routes": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*dispatchers": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*event_charges": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
@@ -907,14 +883,6 @@ func testConsoleItCacheStats(t *testing.T) {
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*tp_dispatcher_hosts": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*tp_dispatcher_profiles": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
},
|
||||
"*tp_filters": map[string]any{
|
||||
"Items": 0.,
|
||||
"Groups": 0.,
|
||||
|
||||
@@ -142,7 +142,6 @@ func runCGREngine(fs []string) (err error) {
|
||||
coreS,
|
||||
services.NewCacheService(cfg),
|
||||
services.NewFilterService(cfg),
|
||||
services.NewDispatcherService(cfg),
|
||||
services.NewLoaderService(cfg),
|
||||
services.NewExportFailoverService(cfg),
|
||||
services.NewAdminSv1Service(cfg),
|
||||
@@ -272,20 +271,11 @@ func cgrInitServiceManagerV1(cfg *config.CGRConfig, srvMngr *servmanager.Service
|
||||
cl := srvDeps[utils.CommonListenerS].(*services.CommonListenerService).CLS()
|
||||
cms := srvDeps[utils.ConnManager].(*services.ConnManagerService)
|
||||
srv, _ := birpc.NewService(apis.NewServiceManagerV1(srvMngr), utils.EmptyString, false)
|
||||
if !cfg.DispatcherSCfg().Enabled {
|
||||
cl.RpcRegister(srv)
|
||||
}
|
||||
cl.RpcRegister(srv)
|
||||
cms.AddInternalConn(utils.ServiceManager, srv)
|
||||
}
|
||||
|
||||
func cgrStartRPC(cfg *config.CGRConfig, registry *servmanager.ServiceRegistry, shutdown *utils.SyncedChan) {
|
||||
if cfg.DispatcherSCfg().Enabled { // wait only for dispatcher as cache is allways registered before this
|
||||
if utils.StructChanTimeout(
|
||||
registry.Lookup(utils.DispatcherS).StateChan(utils.StateServiceUP),
|
||||
cfg.GeneralCfg().ConnectTimeout) {
|
||||
return
|
||||
}
|
||||
}
|
||||
cl := registry.Lookup(utils.CommonListenerS).(*services.CommonListenerService).CLS()
|
||||
cl.StartServer(cfg, shutdown)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user