server+healthcheck: rename function, add absolute disk space function
With this commit we rename the existing AvailableDiskSpace function to its correct name AvailableDiskSpaceRatio as it only returns a ratio. We then go ahead and add a new function that returns the actual number of free bytes available on a file system. This also fixes some comments and always returns an error instead of panicking.
This commit is contained in:
6 files changed
+83
-16
No files matched your search
@@ -1302,7 +1302,9 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
diskCheck := healthcheck.NewObservation(
|
||||
"disk space",
|
||||
func() error {
|
||||
free, err := healthcheck.AvailableDiskSpace(cfg.LndDir)
|
||||
free, err := healthcheck.AvailableDiskSpaceRatio(
|
||||
cfg.LndDir,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user