Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
emrgnt-cmplxty committed Jan 10, 2025
1 parent 7f14361 commit 81017bf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions py/core/main/services/management_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,14 @@ async def get_all_user_limits(self, user_id: UUID) -> dict[str, Any]:
)
)["page_info"]["total_entries"]

max_collections = await self.get_user_max_collections(user_id)
used_collections = (
await self.providers.database.collections_handler.get_collections_overview(
limit=1, offset=0, filter_user_ids=[user_id]
)
)["total_entries"]


storage_limits = {
"chunks": {
"limit": max_chunks,
Expand All @@ -1072,6 +1080,11 @@ async def get_all_user_limits(self, user_id: UUID) -> dict[str, Any]:
"used": used_documents,
"remaining": max_documents - used_documents,
},
"collections": {
"limit": max_collections,
"used": used_collections,
"remaining": max_collections - used_collections,
}
}
# 5) Return a structured response
result = {
Expand Down

0 comments on commit 81017bf

Please sign in to comment.