feat: 增加运行日志(不记录敏感信息) - 启动摘要:端口/间隔/重试/超时/并发/Telegram 状态/内置平台/账号数/数据库路径 - 检查结果:成功余额、认证失败禁用、失败原因 - 提醒状态机:触发提醒/余额恢复 - API 操作:登录、平台/账号增删改、设置修改、密码修改 - Telegram 发送成功、请求耗时(DEBUG) - 全部日志不含 apikey/token/密码
This commit is contained in:
+3
-1
@@ -60,13 +60,15 @@ def fetch_balance(
|
||||
headers["Content-Type"] = "application/json"
|
||||
attempts = retry_count + 1
|
||||
for attempt in range(attempts):
|
||||
t0 = time.time()
|
||||
try:
|
||||
if method == "GET":
|
||||
resp = requests.get(url, headers=headers, timeout=timeout)
|
||||
else:
|
||||
resp = requests.post(url, headers=headers, data=body, timeout=timeout)
|
||||
logger.debug("请求完成 %s -> %s(%.0fms)", url, resp.status_code, (time.time() - t0) * 1000)
|
||||
except requests.RequestException as exc:
|
||||
logger.warning("请求异常(%s/%s) %s: %s", attempt + 1, attempts, url, exc)
|
||||
logger.warning("请求异常(%s/%s) %s: %s(%.0fms)", attempt + 1, attempts, url, exc, (time.time() - t0) * 1000)
|
||||
if attempt < attempts - 1:
|
||||
time.sleep(2)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user