Reimplement the scheduler to be a lot more reliable

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-09-13 19:20:21 -03:00
parent f0c744f0b3
commit d566e5ee05
4 changed files with 148 additions and 360 deletions

13
api.go
View File

@@ -27,16 +27,17 @@ func main() {
core := pwd.NewPWD(f, e, s, sp, ipf)
sch, err := scheduler.NewScheduler(s, e, core)
tasks := []scheduler.Task{
task.NewCheckPorts(e, f),
task.NewCheckSwarmPorts(e, f),
task.NewCheckSwarmStatus(e, f),
task.NewCollectStats(e, f),
}
sch, err := scheduler.NewScheduler(tasks, s, e, core)
if err != nil {
log.Fatal("Error initializing the scheduler: ", err)
}
sch.AddTask(task.NewCheckPorts(e, f))
sch.AddTask(task.NewCheckSwarmPorts(e, f))
sch.AddTask(task.NewCheckSwarmStatus(e, f))
sch.AddTask(task.NewCollectStats(e, f))
sch.Start()
handlers.Bootstrap(core, e)