mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
renamed newservice2 function to newservicewithping
This commit is contained in:
committed by
Dan Christian Bogos
parent
009895f92a
commit
27c4242c52
@@ -148,7 +148,7 @@ func (s RPCClientSet) Call(ctx *context.Context, method string, args any, reply
|
||||
func NewService(val any) (_ IntService, err error) {
|
||||
return NewServiceWithName(val, utils.EmptyString, false)
|
||||
}
|
||||
func NewService2(val any, name, prefix string) (*birpc.Service, error) {
|
||||
func NewServiceWithPing(val any, name, prefix string) (*birpc.Service, error) {
|
||||
srv, err := birpc.NewServiceWithMethodsRename(val, name, true, func(funcName string) string {
|
||||
return strings.TrimPrefix(funcName, prefix)
|
||||
})
|
||||
|
||||
@@ -103,7 +103,7 @@ func (acts *AccountService) Start(ctx *context.Context, _ context.CancelFunc) (e
|
||||
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> starting <%s> subsystem", utils.CoreS, utils.AccountS))
|
||||
|
||||
srv, err := engine.NewService2(acts.acts, utils.AccountSv1, utils.V1Prfx)
|
||||
srv, err := engine.NewServiceWithPing(acts.acts, utils.AccountSv1, utils.V1Prfx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ func (acts *ActionService) Start(ctx *context.Context, _ context.CancelFunc) (er
|
||||
go acts.acts.ListenAndServe(acts.stopChan, acts.rldChan)
|
||||
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> starting <%s> subsystem", utils.CoreS, utils.ActionS))
|
||||
srv, err := engine.NewService2(acts.acts, utils.ActionSv1, utils.V1Prfx)
|
||||
srv, err := engine.NewServiceWithPing(acts.acts, utils.ActionSv1, utils.V1Prfx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ func (cdrSrv *CDRService) Start(ctx *context.Context, _ context.CancelFunc) (err
|
||||
go cdrSrv.cdrS.ListenAndServe(cdrSrv.stopChan)
|
||||
runtime.Gosched()
|
||||
utils.Logger.Info("Registering CDRS RPC service.")
|
||||
srv, err := engine.NewService2(cdrSrv.cdrS, utils.CDRsV1, utils.V1Prfx)
|
||||
srv, err := engine.NewServiceWithPing(cdrSrv.cdrS, utils.CDRsV1, utils.V1Prfx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ func (es *EventExporterService) Start(ctx *context.Context, _ context.CancelFunc
|
||||
es.stopChan = make(chan struct{})
|
||||
go es.eeS.ListenAndServe(es.stopChan, es.rldChan)
|
||||
|
||||
srv, _ := engine.NewService2(es.eeS, utils.EeSv1, utils.V1Prfx)
|
||||
srv, _ := engine.NewServiceWithPing(es.eeS, utils.EeSv1, utils.V1Prfx)
|
||||
// srv, _ := birpc.NewService(es.rpc, "", false)
|
||||
if !es.cfg.DispatcherSCfg().Enabled {
|
||||
es.server.RpcRegister(srv)
|
||||
|
||||
@@ -69,7 +69,7 @@ func (efServ *ExportFailoverService) Start(ctx *context.Context, _ context.Cance
|
||||
efServ.efS = efs.NewEfs(efServ.cfg, efServ.connMgr)
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> starting <%s> subsystem", utils.CoreS, utils.EFs))
|
||||
efServ.stopChan = make(chan struct{})
|
||||
efServ.srv, _ = engine.NewService2(efServ.efS, utils.EfSv1, utils.V1Prfx)
|
||||
efServ.srv, _ = engine.NewServiceWithPing(efServ.efS, utils.EfSv1, utils.V1Prfx)
|
||||
efServ.server.RpcRegister(efServ.srv)
|
||||
efServ.Unlock()
|
||||
return
|
||||
|
||||
@@ -134,7 +134,7 @@ func (rs *RateService) Start(ctx *context.Context, _ context.CancelFunc) (err er
|
||||
rs.stopChan = make(chan struct{})
|
||||
go rs.rateS.ListenAndServe(rs.stopChan, rs.rldChan)
|
||||
|
||||
srv, err := engine.NewService2(rs.rateS, utils.RateSv1, utils.V1Prfx)
|
||||
srv, err := engine.NewServiceWithPing(rs.rateS, utils.RateSv1, utils.V1Prfx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user