Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
aisbf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
aisbf
Commits
b74aa1b2
Commit
b74aa1b2
authored
Jul 26, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/provider-usage-no-500'
parents
11df0261
807aeb24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
providers.py
aisbf/routes/dashboard/providers.py
+7
-1
No files found.
aisbf/routes/dashboard/providers.py
View file @
b74aa1b2
...
...
@@ -2284,7 +2284,13 @@ async def api_provider_usage(request: Request, provider_id: str):
logger
.
warning
(
f
"api_provider_usage error for {provider_id}: {e}"
)
if
cached
:
return
JSONResponse
({
"success"
:
True
,
"supported"
:
True
,
"usage"
:
cached
[
'usage_data'
],
"stale"
:
True
})
return
JSONResponse
({
"success"
:
False
,
"error"
:
str
(
e
)},
status_code
=
500
)
# A usage-fetch failure — invalid/expired credentials, provider offline,
# or an upstream error — is an expected soft condition for a monitoring
# poll, not a server error. Returning 500 spammed the dashboard (which
# polls every provider's usage on a timer) with 500s for any provider
# whose credentials are stale. Degrade gracefully: 200 with usage:None
# and an 'unavailable' flag so the UI can render an offline state.
return
JSONResponse
({
"success"
:
True
,
"supported"
:
True
,
"usage"
:
None
,
"unavailable"
:
True
,
"error"
:
str
(
e
)})
@
router
.
post
(
"/dashboard/api/rotation"
)
...
...
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