setTimeout
This commit is contained in:
@ -347,7 +347,7 @@ module.exports = async ({
|
|||||||
{
|
{
|
||||||
logT('search', 'get torrent via infohash with dht')
|
logT('search', 'get torrent via infohash with dht')
|
||||||
// 3 try to get torrent from metadata
|
// 3 try to get torrent from metadata
|
||||||
const getTorrentMetadata = (tryCount = 4) => {
|
const getTorrentMetadata = (tryCount = 8) => {
|
||||||
if(tryCount <= 0) {
|
if(tryCount <= 0) {
|
||||||
logT('search', 'dht NOT found anything with dht', text);
|
logT('search', 'dht NOT found anything with dht', text);
|
||||||
return
|
return
|
||||||
@ -356,7 +356,7 @@ module.exports = async ({
|
|||||||
dhtCheckTimeout = setTimeout(() => {
|
dhtCheckTimeout = setTimeout(() => {
|
||||||
lock = true
|
lock = true
|
||||||
getTorrentMetadata(--tryCount)
|
getTorrentMetadata(--tryCount)
|
||||||
}, 8000);
|
}, 16000);
|
||||||
torrentClient.getMetadata(text, (torrent) => {
|
torrentClient.getMetadata(text, (torrent) => {
|
||||||
if(lock) {
|
if(lock) {
|
||||||
logT('search', 'this dht response not actual for', text);
|
logT('search', 'this dht response not actual for', text);
|
||||||
|
Reference in New Issue
Block a user