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
4a84ca9a
Commit
4a84ca9a
authored
Feb 09, 2026
by
erio
Browse files
fix: support clearing model-level rate limits from action menu and temp-unsched reset
parent
7d66f7ff
Changes
2
Show whitespace changes
Inline
Side-by-side
backend/internal/service/ratelimit_service.go
View file @
4a84ca9a
...
...
@@ -623,6 +623,10 @@ func (s *RateLimitService) ClearTempUnschedulable(ctx context.Context, accountID
slog
.
Warn
(
"temp_unsched_cache_delete_failed"
,
"account_id"
,
accountID
,
"error"
,
err
)
}
}
// 同时清除模型级别限流
if
err
:=
s
.
accountRepo
.
ClearModelRateLimits
(
ctx
,
accountID
);
err
!=
nil
{
slog
.
Warn
(
"clear_model_rate_limits_on_temp_unsched_reset_failed"
,
"account_id"
,
accountID
,
"error"
,
err
)
}
return
nil
}
...
...
frontend/src/components/admin/account/AccountActionMenu.vue
View file @
4a84ca9a
...
...
@@ -53,7 +53,19 @@ import type { Account } from '@/types'
const
props
=
defineProps
<
{
show
:
boolean
;
account
:
Account
|
null
;
position
:
{
top
:
number
;
left
:
number
}
|
null
}
>
()
const
emit
=
defineEmits
([
'
close
'
,
'
test
'
,
'
stats
'
,
'
reauth
'
,
'
refresh-token
'
,
'
reset-status
'
,
'
clear-rate-limit
'
])
const
{
t
}
=
useI18n
()
const
isRateLimited
=
computed
(()
=>
props
.
account
?.
rate_limit_reset_at
&&
new
Date
(
props
.
account
.
rate_limit_reset_at
)
>
new
Date
())
const
isRateLimited
=
computed
(()
=>
{
if
(
props
.
account
?.
rate_limit_reset_at
&&
new
Date
(
props
.
account
.
rate_limit_reset_at
)
>
new
Date
())
{
return
true
}
const
modelLimits
=
(
props
.
account
?.
extra
as
Record
<
string
,
unknown
>
|
undefined
)?.
model_rate_limits
as
|
Record
<
string
,
{
rate_limit_reset_at
:
string
}
>
|
undefined
if
(
modelLimits
)
{
const
now
=
new
Date
()
return
Object
.
values
(
modelLimits
).
some
(
info
=>
new
Date
(
info
.
rate_limit_reset_at
)
>
now
)
}
return
false
})
const
isOverloaded
=
computed
(()
=>
props
.
account
?.
overload_until
&&
new
Date
(
props
.
account
.
overload_until
)
>
new
Date
())
const
handleKeydown
=
(
event
:
KeyboardEvent
)
=>
{
...
...
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