diff --git a/api/service/manager.go b/api/service/manager.go index fc5834888..176d28326 100644 --- a/api/service/manager.go +++ b/api/service/manager.go @@ -152,3 +152,14 @@ func (m *Manager) StartServiceManager() chan *Action { }() return ch } + +// RunServices run registered services. +func (m *Manager) RunServices() { + for serviceType := range m.services { + action := &Action{ + Action: Start, + ServiceType: serviceType, + } + m.TakeAction(action) + } +} diff --git a/node/node.go b/node/node.go index 78d6f4ef8..042a4b44b 100644 --- a/node/node.go +++ b/node/node.go @@ -709,11 +709,5 @@ func (node *Node) RunServices() { utils.GetLogInstance().Info("Service manager is not set up yet.") return } - for serviceType := range node.serviceManager.GetServices() { - action := &service_manager.Action{ - Action: service_manager.Start, - ServiceType: serviceType, - } - node.serviceManager.TakeAction(action) - } + node.serviceManager.RunServices() }