mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 06:38:45 +05:00
check BiGobListen when (un)registering birpc methods
This commit is contained in:
committed by
Dan Christian Bogos
parent
5726a0911d
commit
92f8e8aed7
@@ -109,7 +109,7 @@ func (smg *SessionService) Start() error {
|
||||
smg.server.RpcRegister(legacySrv)
|
||||
}
|
||||
// Register BiRpc handlers
|
||||
if smg.cfg.ListenCfg().BiJSONListen != "" {
|
||||
if smg.cfg.ListenCfg().BiJSONListen != "" || smg.cfg.ListenCfg().BiGobListen != "" {
|
||||
smg.server.BiRPCRegisterName(utils.SessionSv1, srv)
|
||||
}
|
||||
return nil
|
||||
@@ -129,7 +129,7 @@ func (smg *SessionService) Shutdown() (err error) {
|
||||
if err = smg.sm.Shutdown(); err != nil {
|
||||
return err
|
||||
}
|
||||
if smg.cfg.ListenCfg().BiJSONListen != "" {
|
||||
if smg.cfg.ListenCfg().BiJSONListen != "" || smg.cfg.ListenCfg().BiGobListen != "" {
|
||||
_ = smg.server.BiRPCUnregisterName(utils.SessionSv1)
|
||||
}
|
||||
smg.sm = nil
|
||||
|
||||
@@ -97,7 +97,7 @@ func (thrs *ThresholdService) Start() error {
|
||||
}
|
||||
thrs.connChan <- thrs.anz.GetInternalCodec(srv, utils.ThresholdS)
|
||||
// Register BiRpc handlers
|
||||
if thrs.cfg.ListenCfg().BiJSONListen != "" {
|
||||
if thrs.cfg.ListenCfg().BiJSONListen != "" || thrs.cfg.ListenCfg().BiGobListen != "" {
|
||||
thrs.server.BiRPCRegisterName(utils.ThresholdSv1, srv)
|
||||
}
|
||||
return nil
|
||||
@@ -117,7 +117,7 @@ func (thrs *ThresholdService) Shutdown() (err error) {
|
||||
thrs.Lock()
|
||||
defer thrs.Unlock()
|
||||
thrs.thrs.Shutdown()
|
||||
if thrs.cfg.ListenCfg().BiJSONListen != "" {
|
||||
if thrs.cfg.ListenCfg().BiJSONListen != "" || thrs.cfg.ListenCfg().BiGobListen != "" {
|
||||
_ = thrs.server.BiRPCUnregisterName(utils.ThresholdSv1)
|
||||
}
|
||||
thrs.thrs = nil
|
||||
|
||||
Reference in New Issue
Block a user