Correctly handle updating server data

This commit is contained in:
Dane Everitt
2019-12-21 21:02:02 -08:00
parent d583c1d53e
commit 189289ad5f
6 changed files with 16 additions and 14 deletions

View File

@@ -2,7 +2,7 @@ package server
import (
"fmt"
"github.com/mcuadros/go-defaults"
"github.com/creasty/defaults"
"github.com/patrickmn/go-cache"
"github.com/pkg/errors"
"github.com/pterodactyl/wings/api"
@@ -211,9 +211,8 @@ func (s *Server) Init() {
func FromConfiguration(data []byte, cfg *config.SystemConfiguration) (*Server, error) {
s := new(Server)
defaults.SetDefaults(s)
s.CrashDetection = CrashDetection{
Enabled: true,
if err := defaults.Set(s); err != nil {
return nil, err
}
s.Init()