setTimeout

This commit is contained in:
wenyifan
2023-09-06 00:00:14 +08:00
parent 1233156a64
commit eb7ce30da9

View File

@ -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);