1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-31 07:33:33 +00:00

mount: notice daemon dying much quicker

Before this change we waited until until the timeout to check the
daemon was alive.

Now we check it every 100ms like we do the mount status.

This also fixes compiling on all platforms which was broken by the
previous change

9bfbf2a4a mount: fix macOS not noticing errors with --daemon

See: https://forum.rclone.org/t/rclone-mount-daemon-exits-successfully-even-when-mount-fails/43146
This commit is contained in:
Nick Craig-Wood
2023-11-29 15:11:11 +00:00
parent 97d7945cef
commit caf5dd9d5e
5 changed files with 66 additions and 45 deletions

View File

@@ -3,10 +3,6 @@
package mountlib
import (
"time"
)
// CheckMountEmpty checks if mountpoint folder is empty.
// On non-Linux unixes we list directory to ensure that.
func CheckMountEmpty(mountpoint string) error {
@@ -19,9 +15,5 @@ func CheckMountReady(mountpoint string) error {
return nil
}
// WaitMountReady should wait until mountpoint is mounted by rclone.
// The check is implemented only for Linux so we just sleep a little.
func WaitMountReady(mountpoint string, timeout time.Duration) error {
time.Sleep(timeout)
return nil
}
// CanCheckMountReady is set if CheckMountReady is functional
var CanCheckMountReady = false