替换 localhost 为 127.0.0.1,避免 DNS 解析影响响应速度

This commit is contained in:
JIANG
2025-12-02 10:48:53 +08:00
parent 33c467fe39
commit 523fee275f
7 changed files with 12 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
import redis
redis_client = redis.Redis(host="localhost", port=6379, db=0)
redis_client = redis.Redis(host="127.0.0.1", port=6379, db=0)
matched_keys = redis_client.keys(f"**")
redis_client.delete(*matched_keys)