Merge pull request #54 from cyberkitsune/fast-unlimited-disk
Speed up server power on for servers with unlimited size
This commit is contained in:
commit
d743d8cfeb
|
@ -141,10 +141,16 @@ func (s *Server) onBeforeStart() error {
|
||||||
// and process resource limits are correctly applied.
|
// and process resource limits are correctly applied.
|
||||||
s.SyncWithEnvironment()
|
s.SyncWithEnvironment()
|
||||||
|
|
||||||
|
// If a server has unlimited disk space, we don't care enough to block the startup to check remaining.
|
||||||
|
// However, we should trigger a size anyway, as it'd be good to kick it off for other processes.
|
||||||
|
if s.DiskSpace() <= 0 {
|
||||||
|
s.Filesystem.HasSpaceAvailable(true)
|
||||||
|
} else {
|
||||||
s.PublishConsoleOutputFromDaemon("Checking server disk space usage, this could take a few seconds...")
|
s.PublishConsoleOutputFromDaemon("Checking server disk space usage, this could take a few seconds...")
|
||||||
if !s.Filesystem.HasSpaceAvailable(false) {
|
if !s.Filesystem.HasSpaceAvailable(false) {
|
||||||
return errors.New("cannot start server, not enough disk space available")
|
return errors.New("cannot start server, not enough disk space available")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update the configuration files defined for the server before beginning the boot process.
|
// Update the configuration files defined for the server before beginning the boot process.
|
||||||
// This process executes a bunch of parallel updates, so we just block until that process
|
// This process executes a bunch of parallel updates, so we just block until that process
|
||||||
|
|
Loading…
Reference in New Issue
Block a user