mirror of
https://github.com/fuse-friends/fuse-native
synced 2024-10-27 18:34:01 +00:00
add 3s timeout to unmount since fuse sometimes fails
This commit is contained in:
parent
431d61db79
commit
fb5b51f88b
11
index.js
11
index.js
@ -83,7 +83,16 @@ exports.mount = function (mnt, ops, cb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.unmount = function (mnt, cb) {
|
exports.unmount = function (mnt, cb) {
|
||||||
fuse.unmount(path.resolve(mnt), cb || noop)
|
var timeout = setTimeout(function () {
|
||||||
|
var err = new Error('Unmount took too long')
|
||||||
|
err.code = 'ETIMEDOUT'
|
||||||
|
if (cb) cb(err)
|
||||||
|
}, 2000)
|
||||||
|
|
||||||
|
fuse.unmount(path.resolve(mnt), function (err) {
|
||||||
|
clearTimeout(timeout)
|
||||||
|
if (cb) cb(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.errno = function (code) {
|
exports.errno = function (code) {
|
||||||
|
Loading…
Reference in New Issue
Block a user