[PR #343] refactor: 提取凭证错误处理与重试逻辑为共享函数 #344

Open
opened 2026-02-27 07:19:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/justlovemaki/AIClient-2-API/pull/343
Author: @lly835
Created: 2/26/2026
Status: 🔄 Open

Base: mainHead: refactor/extract-retry-logic


📝 Commits (1)

  • bc16f2f refactor: 提取凭证错误处理与重试逻辑为共享函数 handleCredentialErrorAndRetry

📊 Changes

1 file changed (+95 additions, -153 deletions)

View changed files

📝 src/utils/common.js (+95 -153)

📄 Description

handleStreamRequest 和 handleUnaryRequest 中有约 150 行几乎完全相同的凭证标记不健康 + 切换重试逻辑,提取为 handleCredentialErrorAndRetry 共享函数。

  • 净减 58 行重复代码
  • 统一两处的错误标记和重试行为
  • 保持原有功能和递归重试语义不变

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/justlovemaki/AIClient-2-API/pull/343 **Author:** [@lly835](https://github.com/lly835) **Created:** 2/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `refactor/extract-retry-logic` --- ### 📝 Commits (1) - [`bc16f2f`](https://github.com/justlovemaki/AIClient-2-API/commit/bc16f2f2eb6add95b0dd7d64b4daa1810ece8d25) refactor: 提取凭证错误处理与重试逻辑为共享函数 handleCredentialErrorAndRetry ### 📊 Changes **1 file changed** (+95 additions, -153 deletions) <details> <summary>View changed files</summary> 📝 `src/utils/common.js` (+95 -153) </details> ### 📄 Description handleStreamRequest 和 handleUnaryRequest 中有约 150 行几乎完全相同的凭证标记不健康 + 切换重试逻辑,提取为 handleCredentialErrorAndRetry 共享函数。 - 净减 58 行重复代码 - 统一两处的错误标记和重试行为 - 保持原有功能和递归重试语义不变 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AIClient-2-API-justlovemaki#344
No description provided.