More fixes

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-07-28 23:24:02 -03:00
parent 0e08107738
commit 5ee4bb2011
14 changed files with 125 additions and 49 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/play-with-docker/play-with-docker/event"
"github.com/play-with-docker/play-with-docker/pwd"
"github.com/play-with-docker/play-with-docker/scheduler"
"github.com/play-with-docker/play-with-docker/scheduler/task"
"github.com/play-with-docker/play-with-docker/storage"
)
@@ -18,7 +19,6 @@ var e event.EventApi
var ws *socketio.Server
func Bootstrap() {
s, err := storage.NewFileStorage(config.SessionsFile)
e = event.NewLocalBroker()
@@ -29,7 +29,17 @@ func Bootstrap() {
}
core = pwd.NewPWD(f, e, s)
scheduler.NewScheduler(s, e, core)
sch, err := scheduler.NewScheduler(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()
}
func RegisterEvents(s *socketio.Server) {

View File

@@ -63,7 +63,7 @@ func WS(so socketio.Socket) {
log.Println(err)
return
}
ws.Emit("instance terminal out", instanceName, b)
ws.Emit("instance terminal out", instanceName, string(b))
}
}(instance.Name, conn, ws)
}