Conversation
71cb5ce to
4793ecb
Compare
| repository_ctx: PulpRepositoryContext | None = None, | ||
| ): | ||
| super().__init__(pulp_ctx, pulp_href=pulp_href, entity=entity) | ||
| assert (repository_ctx is None) or (repository_ctx.pulp_ctx is pulp_ctx) |
There was a problem hiding this comment.
Tell me what the intent is here? I'm missing something
There was a problem hiding this comment.
This is unrelated. But it's a safeguard that the repository this content context is tied to here belongs to the same server (pulp_ctx).
|
|
||
| sha256_hasher = hashlib.sha256() | ||
| for chunk in iter(lambda: file.read(chunk_size), b""): | ||
| for chunk in iter(lambda: file.read(10_000_000), b""): |
There was a problem hiding this comment.
Any particular reason for 10Mb here? Or is it just "a reasonable amount at a time" to hash?
There was a problem hiding this comment.
This is not any sort of chunk to be used on the network. Here we only hash the file to secure the upload later.
So no reason but that the "other" chunk_size now became unreliable.
There was a problem hiding this comment.
Right - I was just curious if 10Mb was "magic" in some way, or just "a reasonable amount" :)
| if value == "": | ||
| # Actually override the default. | ||
| return None |
There was a problem hiding this comment.
Can we push these into parse_size()?
There was a problem hiding this comment.
We commonly "use" "" to represent resetting over None which was "not specified". I don't think we need that in the settings file.
Users experiencing issues when uploading huge files can now define a default chunk size to use per server profile. Co-authored-by: Grant Gainey <ggainey@users.noreply.github.com>
29be281 to
2306bf3
Compare
Users experiencing issues when uploading huge files can now define a default chunk size to use per server profile.