fix(p2p): closing on end

This commit is contained in:
Alexey Kasyanchuk 2018-02-17 20:09:29 +03:00
parent c33f927a7d
commit 196f04645c

View File

@ -1174,12 +1174,15 @@ if(config.spaceQuota)
this.stop = (callback) => {
console.log('spider closing...')
torrentClient.destroy(() => {
sphinx.end(() => spider.close(() => {
mysqlSingle.destroy()
console.log('spider closed')
callback()
}))
tcpServer.close(() => {
console.log('p2p server closed')
torrentClient.destroy(() => {
sphinx.end(() => spider.close(() => {
mysqlSingle.destroy()
console.log('spider closed')
callback()
}))
})
})
}
return this