Refactor and translate comments and docstrings in utility modules to English for better clarity and maintainability. Update Gunicorn and application startup messages for consistency in language. Enhance documentation with English translations for better accessibility.

This commit is contained in:
dienakdz
2026-04-06 16:47:36 +07:00
parent 3ca291a346
commit 11e2e5aaa6
64 changed files with 2323 additions and 2336 deletions
+7 -7
View File
@@ -1,5 +1,5 @@
"""
HTTP 工具模块
HTTP tool module
"""
import requests
from requests.adapters import HTTPAdapter
@@ -12,15 +12,15 @@ def get_retry_session(
status_forcelist: tuple = (500, 502, 503, 504)
) -> requests.Session:
"""
获取带重试机制的 HTTP Session
Get HTTP Session with retry mechanism
Args:
retries: 重试次数
backoff_factor: 重试间隔因子
status_forcelist: 需要重试的 HTTP 状态码
retries: number of retries
backoff_factor: retry interval factor
status_forcelist: HTTP status codes that need to be retried
Returns:
配置好的 Session 实例
Configured Session instance
"""
session = requests.Session()
retry = Retry(
@@ -36,6 +36,6 @@ def get_retry_session(
return session
# 全局共享 Session
# Global shared session
global_session = get_retry_session()