Correctly connect to running containers
This commit is contained in:
parent
aa710ec9d6
commit
7c82c6445d
|
@ -149,7 +149,6 @@ func (d *DockerEnvironment) Start() error {
|
|||
return err
|
||||
}
|
||||
|
||||
d.FollowConsoleOutput()
|
||||
return d.Attach()
|
||||
}
|
||||
|
||||
|
@ -188,6 +187,10 @@ func (d *DockerEnvironment) Attach() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
if err := d.FollowConsoleOutput(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
var err error
|
||||
|
|
|
@ -78,9 +78,6 @@ func (rt *Router) routeWebsocket(w http.ResponseWriter, r *http.Request, ps http
|
|||
defer s.RemoveListener(server.ConsoleOutputEvent, &handleOutput)
|
||||
|
||||
s.Emit(server.StatusEvent, s.State)
|
||||
if s.State != server.ProcessOfflineState {
|
||||
handler.HandleInbound(WebsocketMessage{inbound: true, Event: SendServerLogsEvent})
|
||||
}
|
||||
|
||||
for {
|
||||
j := WebsocketMessage{inbound: true}
|
||||
|
|
2
wings.go
2
wings.go
|
@ -74,6 +74,8 @@ func main() {
|
|||
zap.S().Infow("detected server is running, re-attaching to process", zap.String("server", s.Uuid))
|
||||
if err := s.Environment.Attach(); err != nil {
|
||||
zap.S().Errorw("error attaching to server environment", zap.String("server", s.Uuid), zap.Error(err))
|
||||
} else {
|
||||
s.SetState(server.ProcessRunningState)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user