Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
28327106
authored
Jan 06, 2026
by
Xyfacai
Committed by
GitHub
Jan 06, 2026
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2588 from PowerfulBart/fix/auto-group-task-logging
fix(task): 修复使用 auto 分组时 Task Relay 不记录日志和不扣费的问题
parents
e71be750
d2a91eff
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
relay/relay_task.go
+8
-0
No files found.
relay/relay_task.go
View file @
28327106
...
@@ -150,6 +150,14 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
...
@@ -150,6 +150,14 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
}
}
}
}
// 处理 auto 分组:从 context 获取实际选中的分组
// 当使用 auto 分组时,Distribute 中间件会将实际选中的分组存储在 ContextKeyAutoGroup 中
if
autoGroup
,
exists
:=
common
.
GetContextKey
(
c
,
constant
.
ContextKeyAutoGroup
);
exists
{
if
groupStr
,
ok
:=
autoGroup
.
(
string
);
ok
&&
groupStr
!=
""
{
info
.
UsingGroup
=
groupStr
}
}
// 预扣
// 预扣
groupRatio
:=
ratio_setting
.
GetGroupRatio
(
info
.
UsingGroup
)
groupRatio
:=
ratio_setting
.
GetGroupRatio
(
info
.
UsingGroup
)
var
ratio
float64
var
ratio
float64
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment