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,6 +1174,8 @@ if(config.spaceQuota)
this.stop = (callback) => { this.stop = (callback) => {
console.log('spider closing...') console.log('spider closing...')
tcpServer.close(() => {
console.log('p2p server closed')
torrentClient.destroy(() => { torrentClient.destroy(() => {
sphinx.end(() => spider.close(() => { sphinx.end(() => spider.close(() => {
mysqlSingle.destroy() mysqlSingle.destroy()
@ -1181,6 +1183,7 @@ this.stop = (callback) => {
callback() callback()
})) }))
}) })
})
} }
return this return this