diff --git a/chromadb/quota/__init__.py b/chromadb/quota/__init__.py index 82365ff1bd1..eebc8f70b00 100644 --- a/chromadb/quota/__init__.py +++ b/chromadb/quota/__init__.py @@ -60,6 +60,7 @@ def __init__(self, system: System) -> None: def static_check(self, metadatas: Optional[Metadatas] = None, documents: Optional[Documents] = None, embeddings: Optional[Embeddings] = None, collection_id: Optional[str] = None): + if not self.should_enforce: return metadata_key_length_quota = self._quota_provider.get_for_subject(resource=Resource.METADATA_KEY_LENGTH, diff --git a/chromadb/server/fastapi/__init__.py b/chromadb/server/fastapi/__init__.py index fa057b90d29..5eccc54d819 100644 --- a/chromadb/server/fastapi/__init__.py +++ b/chromadb/server/fastapi/__init__.py @@ -293,7 +293,7 @@ def app(self) -> fastapi.FastAPI: def root(self) -> Dict[str, int]: return {"nanosecond heartbeat": self._api.heartbeat()} - async def quota_exception_handler(request: Request, exc: QuotaError): + async def quota_exception_handler(self, request: Request, exc: QuotaError): return JSONResponse( status_code=429, content={"message": f"quota error. resource: {exc.resource} quota: {exc.quota} actual: {exc.actual}"},