feat(quota): implement workspace-level quota enforcement and statistics
- Refactor quota management logic to support usage checks scoped by workspace. - Update quota statistics API to return granular quota details for each workspace. - Revise default configuration settings for terminal user and model limits. - Remove quota check decorators from the model controller.
This commit is contained in:
@@ -114,7 +114,7 @@ async def chat(
|
||||
from app.models.workspace_model import Workspace
|
||||
ws = db.query(Workspace).filter(Workspace.id == workspace_id).first()
|
||||
if ws:
|
||||
_check_quota(db, ws.tenant_id, "end_user_quota", "end_user")
|
||||
_check_quota(db, ws.tenant_id, "end_user_quota", "end_user", workspace_id=workspace_id)
|
||||
|
||||
new_end_user = end_user_repo.get_or_create_end_user(
|
||||
app_id=app.id,
|
||||
|
||||
Reference in New Issue
Block a user