Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid checking max_vfolder_count #1397

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/1397.fix.md
@@ -0,0 +1 @@
Avoid checking resource policy's max_vfolder_count
12 changes: 6 additions & 6 deletions src/ai/backend/manager/api/vfolder.py
Expand Up @@ -455,12 +455,12 @@ async def create(request: web.Request, params: Any) -> web.Response:
permission=VFolderHostPermission.CREATE,
)

# Check resource policy's max_vfolder_count
if keypair_resource_policy["max_vfolder_count"] > 0:
query = sa.select([sa.func.count()]).where(vfolders.c.user == user_uuid)
result = await conn.scalar(query)
if result >= keypair_resource_policy["max_vfolder_count"]:
raise InvalidAPIParameters("You cannot create more vfolders.")
# DEPRECATED: Check resource policy's max_vfolder_count
# if keypair_resource_policy["max_vfolder_count"] > 0:
# query = sa.select([sa.func.count()]).where(vfolders.c.user == user_uuid)
# result = await conn.scalar(query)
# if result >= keypair_resource_policy["max_vfolder_count"]:
# raise InvalidAPIParameters("You cannot create more vfolders.")

# DEPRECATED: Limit vfolder size quota if it is larger than max_vfolder_size of the resource policy.
# max_vfolder_size = resource_policy.get("max_vfolder_size", 0)
Expand Down