move run services to service manager

pull/385/head
Minh Doan 6 years ago committed by Minh Doan
parent 455bfc8f83
commit 15cc4e04ba
  1. 11
      api/service/manager.go
  2. 8
      node/node.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)
}
}

@ -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()
}

Loading…
Cancel
Save