sshfs
sshfs copied to clipboard
Set cachable to false
Closes issue #42
At the moment, because SSHFS is considered cachable, creating a new filesystem doesn't create a new connection, and maintains the old one.
That's probably not a good fit for SFTP connections, since they're likely to timeout and be closed off after a while, so almost any long running process using SSHFS is eventually going to hit an issue where the filesystem continues to reference a closed off connection, and the cache needs to be manually cleared.
To fix that, I've just set "cachable" to False here, so that creating a new filesystem would also bring in a new connection.
Honestly, I don't have the knowledge to know the full implications of this, but my main thoughts are:
- Does this mean it's worth adding in something to clean up / close the connection when the SSHFS object goes out of memory? (otherwise there are potentially open but unusable connections floating around)
- Is there a case where you'd want it to be cachable? In which case, the "cachable" setting could theoretically be put behind an
__init__argument? (my guess is that'd cause some kind of side effects nobody is expecting though)