Spaces:
Paused
Paused
Upload unified-server.js
Browse files- unified-server.js +6 -4
unified-server.js
CHANGED
|
@@ -665,13 +665,15 @@ class RequestHandler {
|
|
| 665 |
}
|
| 666 |
|
| 667 |
async processRequest(req, res) {
|
| 668 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 669 |
|
| 670 |
// --- 升级的统计逻辑 ---
|
| 671 |
this.serverSystem.stats.totalCalls++;
|
| 672 |
-
const currentAccount = this.browserManager.currentAuthIndex;
|
| 673 |
-
const modelName = this._getModelFromRequest(req);
|
| 674 |
-
|
| 675 |
if (this.serverSystem.stats.accountCalls[currentAccount]) {
|
| 676 |
this.serverSystem.stats.accountCalls[currentAccount].total = (this.serverSystem.stats.accountCalls[currentAccount].total || 0) + 1;
|
| 677 |
this.serverSystem.stats.accountCalls[currentAccount].models[modelName] = (this.serverSystem.stats.accountCalls[currentAccount].models[modelName] || 0) + 1;
|
|
|
|
| 665 |
}
|
| 666 |
|
| 667 |
async processRequest(req, res) {
|
| 668 |
+
// 提前获取模型名称和当前账号
|
| 669 |
+
const modelName = this._getModelFromRequest(req);
|
| 670 |
+
const currentAccount = this.currentAuthIndex;
|
| 671 |
+
|
| 672 |
+
// 新增的合并日志行,报告路径、账号和模型
|
| 673 |
+
this.logger.info(`[请求] ${req.method} ${req.path} | 账号: ${currentAccount} | 模型: 🤖 ${modelName}`);
|
| 674 |
|
| 675 |
// --- 升级的统计逻辑 ---
|
| 676 |
this.serverSystem.stats.totalCalls++;
|
|
|
|
|
|
|
|
|
|
| 677 |
if (this.serverSystem.stats.accountCalls[currentAccount]) {
|
| 678 |
this.serverSystem.stats.accountCalls[currentAccount].total = (this.serverSystem.stats.accountCalls[currentAccount].total || 0) + 1;
|
| 679 |
this.serverSystem.stats.accountCalls[currentAccount].models[modelName] = (this.serverSystem.stats.accountCalls[currentAccount].models[modelName] || 0) + 1;
|