Skip to content

Commit

Permalink
Promote Flasks MAX_CONTENT_LENGTH config to datalab setting to forc…
Browse files Browse the repository at this point in the history
…e setting; make default 100 GB
  • Loading branch information
ml-evs committed Oct 24, 2023
1 parent 527dd9c commit 1b558cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pydatalab/pydatalab/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ class ServerConfig(BaseSettings):
None, description="A dictionary containing metadata to serve at `/info`."
)

MAX_CONTENT_LENGTH: int = Field(
100 * 1000 * 1000,
description=r"""Direct mapping to the equivalent Flask setting. In practice, limits the file size that can be uploaded.
Defaults to 100 GB to avoid filling the tmp directory of a server.
Warning: this value will overwrite any other values passed to `FLASK_MAX_CONTENT_LENGTH` but is included here to clarify
its importance when deploying a datalab instance.""",
)

@root_validator
def validate_cache_ages(cls, values):
if values.get("REMOTE_CACHE_MIN_AGE") > values.get("REMOTE_CACHE_MAX_AGE"):
Expand Down

0 comments on commit 1b558cf

Please sign in to comment.