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
1 changed files with 9 additions and 1 deletions
|
@ -122,7 +122,15 @@ func mountRc(ctx context.Context, in rc.Params) (out rc.Params, err error) {
|
|||
log.Printf("mount FAILED: %v", 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
|
||||
liveMounts[mountPoint] = mnt
|
||||
|
||||
|
|
Loading…
Reference in a new issue