替换 localhost 为 127.0.0.1,避免 DNS 解析影响响应速度
This commit is contained in:
@@ -46,7 +46,7 @@ def queryallrecordsbydate_by_url(querydate: str):
|
||||
|
||||
try:
|
||||
response = urllib.request.urlopen(
|
||||
f"http://localhost/queryallrecordsbydate/?querydate={querydate}"
|
||||
f"http://127.0.0.1/queryallrecordsbydate/?querydate={querydate}"
|
||||
)
|
||||
html = response.read().decode("utf-8")
|
||||
|
||||
@@ -66,7 +66,7 @@ def queryallscadarecordsbydate_by_url(querydate: str):
|
||||
|
||||
try:
|
||||
response = urllib.request.urlopen(
|
||||
f"http://localhost/queryallscadarecordsbydate/?querydate={querydate}"
|
||||
f"http://127.0.0.1/queryallscadarecordsbydate/?querydate={querydate}"
|
||||
)
|
||||
html = response.read().decode("utf-8")
|
||||
|
||||
@@ -77,7 +77,7 @@ def queryallscadarecordsbydate_by_url(querydate: str):
|
||||
def auto_cache_data():
|
||||
# 初始化 Redis 连接
|
||||
# 用redis 限制并发访u
|
||||
redis_client = redis.Redis(host="localhost", port=6379, db=0)
|
||||
redis_client = redis.Redis(host="127.0.0.1", port=6379, db=0)
|
||||
|
||||
# auto cache data for the last 3 days
|
||||
today = datetime.date.today()
|
||||
|
||||
Reference in New Issue
Block a user