Whoops, sync correctly

This commit is contained in:
Dane Everitt
2020-07-19 17:26:53 -07:00
parent 16467fa7ff
commit 21e58b57a1
2 changed files with 5 additions and 7 deletions

View File

@@ -57,7 +57,7 @@ func LoadDirectory() error {
defer wg.Done()
log.WithField("uuid", uuid).Debug("creating server object from configuration")
s, err := FromConfiguration(data, false)
s, err := FromConfiguration(data)
if err != nil {
log.WithField("server", uuid).WithField("error", err).Error("failed to load server, skipping...")
return
@@ -82,7 +82,7 @@ func LoadDirectory() error {
// 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 *api.ServerConfigurationResponse, sync bool) (*Server, error) {
func FromConfiguration(data *api.ServerConfigurationResponse) (*Server, error) {
cfg := Configuration{}
if err := defaults.Set(&cfg); err != nil {
return nil, err
@@ -114,10 +114,8 @@ func FromConfiguration(data *api.ServerConfigurationResponse, sync bool) (*Serve
}
// Forces the configuration to be synced with the panel.
if sync {
if err := s.SyncWithConfiguration(data); err != nil {
return nil, err
}
if err := s.SyncWithConfiguration(data); err != nil {
return nil, err
}
return s, nil