check BiGobListen when (un)registering birpc methods

This commit is contained in:
ionutboangiu
2026-02-17 20:20:34 +02:00
committed by Dan Christian Bogos
parent 5726a0911d
commit 92f8e8aed7
2 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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