fix: 修复截图登录检查逻辑的条件判断错误
问题:attempt > 0 应该是 attempt > 1 - attempt 从 range(1, max_retries + 1) 开始,值为 1, 2, 3 - 原条件 attempt > 0 在 attempt=1 时就为 True - 导致 elif 分支(首次尝试逻辑)成为死代码 修复: - 将 attempt > 0 改为 attempt > 1 - 更新注释使其更清晰准确 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -252,8 +252,8 @@ def take_screenshot_for_account(
|
||||
|
||||
# 智能登录状态检查:只在必要时才刷新登录
|
||||
should_refresh_login = not is_cookie_jar_fresh(cookie_path)
|
||||
if should_refresh_login and attempt > 0:
|
||||
# 只有在重试时才刷新登录,避免重复登录操作
|
||||
if should_refresh_login and attempt > 1:
|
||||
# 重试时刷新登录(attempt > 1 表示第2次及以后的尝试)
|
||||
log_to_client("正在刷新登录态...", user_id, account_id)
|
||||
if not _ensure_login_cookies(account, proxy_config, custom_log):
|
||||
log_to_client("截图登录失败", user_id, account_id)
|
||||
|
||||
Reference in New Issue
Block a user