Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cleanup DHT tables cache on torrent removal #1289

Open
wants to merge 5 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

fix opening some files after download finished

  • Loading branch information
DEgITx committed Sep 25, 2018
commit eee6b15f180baf6774d46cfadcc71cd6e7393bb6
@@ -1603,9 +1603,29 @@ Torrent.prototype._checkDone = function () {
if (!done) break
}
if (!self.done && done) {
const done = () => {
self.done = true
self._debug('torrent done: ' + self.infoHash)
self.emit('done')
self._debug('torrent done: ' + self.infoHash)
self.emit('done')
}
// flush files to be able to open after download finish
if(self._store === FSChunkStore)
{
let tasks = self.store.store.files.map(function (file) {
return function (cb) {
file.open(function (err, file) {
// an open error is okay because that means the file is not open
if (err) return cb(null)
file.close(cb)
})
}
})
parallel(tasks, done)
}
else
{
done()
}
}
self._gcSelections()

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.