mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
return if Service Start/Shutdown errors
Previously, a couple cases could just close the shutdown channel but in logs it would appear as if they have been started.
This commit is contained in:
committed by
Dan Christian Bogos
parent
4afe92695c
commit
9812e6f605
@@ -64,6 +64,7 @@ func (m *ServiceManager) StartServices(shutdown *utils.SyncedChan) {
|
||||
if err := svc.Start(shutdown, m.registry); err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> failed to start <%s> service: %v", utils.ServiceManager, svc.ServiceName(), err))
|
||||
shutdown.CloseOnce()
|
||||
return
|
||||
}
|
||||
MustSetState(svc, utils.StateServiceUP)
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> started <%s> service", utils.ServiceManager, svc.ServiceName()))
|
||||
@@ -116,6 +117,7 @@ func (m *ServiceManager) reloadService(id string, shutdown *utils.SyncedChan) (e
|
||||
if err = svc.Shutdown(m.registry); err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> failed to shut down <%s> service: %v", utils.ServiceManager, svc.ServiceName(), err))
|
||||
shutdown.CloseOnce()
|
||||
return
|
||||
}
|
||||
MustSetState(svc, utils.StateServiceDOWN)
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> stopped <%s> service", utils.ServiceManager, svc.ServiceName()))
|
||||
|
||||
Reference in New Issue
Block a user