Sync all server details when booting daemon or server process

This commit is contained in:
Dane Everitt
2019-12-22 13:21:21 -08:00
parent 834f0122e3
commit fabaf21a0d
5 changed files with 66 additions and 32 deletions

View File

@@ -151,15 +151,11 @@ func (d *DockerEnvironment) InSituUpdate() error {
// state. This ensures that unexpected container deletion while Wings is running does
// not result in the server becoming unbootable.
func (d *DockerEnvironment) OnBeforeStart() error {
c, rerr, err := d.Server.GetProcessConfiguration()
if err != nil {
zap.S().Infow("syncing server configuration with Panel", zap.String("server", d.Server.Uuid))
if err := d.Server.Sync(); err != nil {
return err
} else if rerr != nil {
return errors.New(rerr.String())
}
d.Server.processConfiguration = c
// If the server requires a rebuild, go ahead and delete the container from the system which
// will allow the subsequent Create() call to create a new container instance for the server
// to run in.