mirror of
https://github.com/rclone/rclone.git
synced 2025-02-20 07:48:33 +02:00
rc: handle external unmount when mounting
Before this change, if the a mount was created via the rc but unmounted externally with `fusermount -u` say, rclone would still believe the mount was active when it wasn't.
This commit is contained in:
parent
a3c06b9bbe
commit
c5109408c0
@ -122,7 +122,15 @@ func mountRc(ctx context.Context, in rc.Params) (out rc.Params, err error) {
|
|||||||
log.Printf("mount FAILED: %v", err)
|
log.Printf("mount FAILED: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
go func() {
|
||||||
|
if err = mnt.Wait(); err != nil {
|
||||||
|
log.Printf("unmount FAILED: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mountMu.Lock()
|
||||||
|
defer mountMu.Unlock()
|
||||||
|
delete(liveMounts, mountPoint)
|
||||||
|
}()
|
||||||
// Add mount to list if mount point was successfully created
|
// Add mount to list if mount point was successfully created
|
||||||
liveMounts[mountPoint] = mnt
|
liveMounts[mountPoint] = mnt
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user