forked from LBRYCommunity/lbry-sdk
results are indexed by ip, setdefault after resolve
This commit is contained in:
parent
c276053301
commit
235cc5dc05
1 changed files with 1 additions and 1 deletions
|
@ -197,12 +197,12 @@ class TrackerClient:
|
||||||
|
|
||||||
async def _probe_server(self, info_hash, tracker_host, tracker_port, stopped=False):
|
async def _probe_server(self, info_hash, tracker_host, tracker_port, stopped=False):
|
||||||
result = None
|
result = None
|
||||||
self.results.setdefault(tracker_host, {})
|
|
||||||
try:
|
try:
|
||||||
tracker_host = await resolve_host(tracker_host, tracker_port, 'udp')
|
tracker_host = await resolve_host(tracker_host, tracker_port, 'udp')
|
||||||
except socket.error:
|
except socket.error:
|
||||||
log.warning("DNS failure while resolving tracker host: %s, skipping.", tracker_host)
|
log.warning("DNS failure while resolving tracker host: %s, skipping.", tracker_host)
|
||||||
return
|
return
|
||||||
|
self.results.setdefault(tracker_host, {})
|
||||||
if info_hash in self.results[tracker_host]:
|
if info_hash in self.results[tracker_host]:
|
||||||
next_announcement, result = self.results[tracker_host][info_hash]
|
next_announcement, result = self.results[tracker_host][info_hash]
|
||||||
if time.time() < next_announcement:
|
if time.time() < next_announcement:
|
||||||
|
|
Loading…
Reference in a new issue