Merge pull request #48 from pterodactyl/fix/race-2
Fix race condition on startup
This commit is contained in:
commit
cba689136a
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
||||||
build:
|
build:
|
||||||
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -gcflags "all=-trimpath=/Users/dane/Sites/development/code" -o build/wings_linux_amd64 -v wings.go
|
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -gcflags "all=-trimpath=$(PWD)" -o build/wings_linux_amd64 -v wings.go
|
||||||
|
|
||||||
compress:
|
compress:
|
||||||
upx --brute build/wings_*
|
upx --brute build/wings_*
|
||||||
|
|
|
@ -104,15 +104,15 @@ func FromConfiguration(data *api.ServerConfigurationResponse) (*Server, error) {
|
||||||
Server: s,
|
Server: s,
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the server's data directory exists, force disk usage calculation.
|
|
||||||
if _, err := os.Stat(s.Filesystem.Path()); err == nil {
|
|
||||||
go s.Filesystem.HasSpaceAvailable()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Forces the configuration to be synced with the panel.
|
// Forces the configuration to be synced with the panel.
|
||||||
if err := s.SyncWithConfiguration(data); err != nil {
|
if err := s.SyncWithConfiguration(data); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the server's data directory exists, force disk usage calculation.
|
||||||
|
if _, err := os.Stat(s.Filesystem.Path()); err == nil {
|
||||||
|
go s.Filesystem.HasSpaceAvailable()
|
||||||
|
}
|
||||||
|
|
||||||
return s, nil
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user