Truncate the logs when server process is starting
This commit is contained in:
parent
7a52e3a9c2
commit
9c252a5ad7
|
@ -128,7 +128,11 @@ func (d *DockerEnvironment) Start() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
opts := types.ContainerStartOptions{}
|
||||
// Truncate the log file so we don't end up outputting a bunch of useless log information
|
||||
// to the websocket and whatnot.
|
||||
if err := os.Truncate(c.LogPath, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
d.Server.Emit(StatusEvent, ProcessStartingState)
|
||||
|
||||
|
@ -139,6 +143,7 @@ func (d *DockerEnvironment) Start() error {
|
|||
return err
|
||||
}
|
||||
|
||||
opts := types.ContainerStartOptions{}
|
||||
if err := d.Client.ContainerStart(context.Background(), d.Server.Uuid, opts); err != nil {
|
||||
d.Server.Emit(StatusEvent, ProcessOfflineState)
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue
Block a user