Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
49915987
"frontend/src/views/git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "1b53ffcac71242840a54ef102977e94e204aefc1"
Commit
49915987
authored
Apr 12, 2026
by
erio
Browse files
fix: gofmt websearch manager
parent
fda61b06
Changes
1
Show whitespace changes
Inline
Side-by-side
backend/internal/pkg/websearch/manager.go
View file @
49915987
...
@@ -152,14 +152,16 @@ func (m *Manager) filterAvailableProviders(ctx context.Context, accountProxyURL
...
@@ -152,14 +152,16 @@ func (m *Manager) filterAvailableProviders(ctx context.Context, accountProxyURL
return
out
return
out
}
}
// weighted is a provider candidate with computed quota weight.
type
weighted
struct
{
cfg
ProviderConfig
weight
int64
}
// selectByQuotaWeight orders candidates by remaining quota weight.
// selectByQuotaWeight orders candidates by remaining quota weight.
// Providers with quota_limit=0 (no limit set) get weight 0 and are placed last.
// Providers with quota_limit=0 (no limit set) get weight 0 and are placed last.
// Among providers with quota, higher remaining quota = higher priority.
// Among providers with quota, higher remaining quota = higher priority.
func
(
m
*
Manager
)
selectByQuotaWeight
(
ctx
context
.
Context
,
candidates
[]
ProviderConfig
)
[]
ProviderConfig
{
func
(
m
*
Manager
)
selectByQuotaWeight
(
ctx
context
.
Context
,
candidates
[]
ProviderConfig
)
[]
ProviderConfig
{
type
weighted
struct
{
cfg
ProviderConfig
weight
int64
}
items
:=
make
([]
weighted
,
0
,
len
(
candidates
))
items
:=
make
([]
weighted
,
0
,
len
(
candidates
))
for
_
,
cfg
:=
range
candidates
{
for
_
,
cfg
:=
range
candidates
{
w
:=
int64
(
0
)
w
:=
int64
(
0
)
...
...
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