mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
更改日志级别
This commit is contained in:
@@ -28,10 +28,10 @@ async def dns_query_a(hostname):
|
|||||||
"""
|
"""
|
||||||
resolver = dns_resolver()
|
resolver = dns_resolver()
|
||||||
try:
|
try:
|
||||||
answer = resolver.query(hostname, 'A')
|
answer = await resolver.query(hostname, 'A')
|
||||||
except BaseException as e:
|
except BaseException as exception:
|
||||||
logger.log('DEBUG', e.args)
|
logger.log('TRACE', exception.args)
|
||||||
answer = None
|
answer = exception
|
||||||
return answer
|
return answer
|
||||||
|
|
||||||
|
|
||||||
@@ -48,11 +48,12 @@ def resolve_callback(future, index, datas):
|
|||||||
datas[index]['ips'] = str(e.args)
|
datas[index]['ips'] = str(e.args)
|
||||||
datas[index]['valid'] = 0
|
datas[index]['valid'] = 0
|
||||||
else:
|
else:
|
||||||
if answer:
|
if isinstance(answer, dns.resolver.Answer):
|
||||||
ips = {item.address for item in answer}
|
ips = {item.address for item in answer}
|
||||||
datas[index]['ips'] = str(ips)
|
datas[index]['ips'] = str(ips)
|
||||||
else:
|
else:
|
||||||
datas[index]['ips'] = 'No answers'
|
datas[index]['ips'] = 'Something error'
|
||||||
|
datas[index]['valid'] = 0
|
||||||
|
|
||||||
|
|
||||||
async def bulk_query_a(datas):
|
async def bulk_query_a(datas):
|
||||||
@@ -80,10 +81,7 @@ async def bulk_query_a(datas):
|
|||||||
desc='Progress',
|
desc='Progress',
|
||||||
smoothing=1.0,
|
smoothing=1.0,
|
||||||
ncols=True):
|
ncols=True):
|
||||||
try:
|
|
||||||
await future
|
await future
|
||||||
except:
|
|
||||||
pass
|
|
||||||
# await asyncio.wait(tasks) # 等待所有task完成
|
# await asyncio.wait(tasks) # 等待所有task完成
|
||||||
logger.log('INFOR', '完成异步查询子域的A记录')
|
logger.log('INFOR', '完成异步查询子域的A记录')
|
||||||
return datas
|
return datas
|
||||||
|
|||||||
Reference in New Issue
Block a user