Removes SyncServersOnBoot configuration option and requires that servers are synced when the daemon boots
This commit is contained in:
@@ -179,7 +179,7 @@ func LoadDirectory(dir string, cfg *config.SystemConfiguration) error {
|
||||
return
|
||||
}
|
||||
|
||||
s, err := FromConfiguration(b, cfg, false)
|
||||
s, err := FromConfiguration(b, cfg)
|
||||
if err != nil {
|
||||
if IsServerDoesNotExistError(err) {
|
||||
zap.S().Infow("server does not exist on remote system", zap.String("server", file.Name()))
|
||||
@@ -209,7 +209,7 @@ func (s *Server) Init() {
|
||||
// Initializes a server using a data byte array. This will be marshaled into the
|
||||
// given struct using a YAML marshaler. This will also configure the given environment
|
||||
// for a server.
|
||||
func FromConfiguration(data []byte, cfg *config.SystemConfiguration, forceSync bool) (*Server, error) {
|
||||
func FromConfiguration(data []byte, cfg *config.SystemConfiguration) (*Server, error) {
|
||||
s := new(Server)
|
||||
|
||||
if err := defaults.Set(s); err != nil {
|
||||
@@ -241,13 +241,9 @@ func FromConfiguration(data []byte, cfg *config.SystemConfiguration, forceSync b
|
||||
}
|
||||
s.Resources = ResourceUsage{}
|
||||
|
||||
// This is also done when the server is booted, however we need to account for instances
|
||||
// where the server is already running and the Daemon reboots. In those cases this will
|
||||
// allow us to you know, stop servers.
|
||||
if forceSync || cfg.SyncServersOnBoot {
|
||||
if err := s.Sync(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Forces the configuration to be synced with the panel.
|
||||
if err := s.Sync(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return s, nil
|
||||
|
||||
Reference in New Issue
Block a user