feat(trackers): closing ability
This commit is contained in:
parent
ff28e70251
commit
0fe31cbb6e
@ -127,6 +127,13 @@ module.exports = function (send, recive, dataDirectory, version, env)
|
|||||||
tracker.findHash(hash).then(data => callback(tracker.name(), data))
|
tracker.findHash(hash).then(data => callback(tracker.name(), data))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async close()
|
||||||
|
{
|
||||||
|
for(const tracker of this.trackers)
|
||||||
|
if(tracker.close)
|
||||||
|
await tracker.close()
|
||||||
|
}
|
||||||
|
|
||||||
update({hash, name})
|
update({hash, name})
|
||||||
{
|
{
|
||||||
this.findHash(hash, (tracker, data) => {
|
this.findHash(hash, (tracker, data) => {
|
||||||
@ -871,6 +878,10 @@ module.exports = function (send, recive, dataDirectory, version, env)
|
|||||||
// save feed
|
// save feed
|
||||||
await feed.save()
|
await feed.save()
|
||||||
|
|
||||||
|
// close trackers if needed
|
||||||
|
logT('close', 'closing trackers')
|
||||||
|
await remoteTrackers.close()
|
||||||
|
|
||||||
// stop bootstrap interval
|
// stop bootstrap interval
|
||||||
if(config.p2pBootstrap && p2pBootstrapLoop)
|
if(config.p2pBootstrap && p2pBootstrapLoop)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user