Skip to content

Reject negative cache size limits#1341

Open
CodingFeng101 wants to merge 1 commit into
scrapinghub:masterfrom
CodingFeng101:codex/reject-negative-cache-size-limit
Open

Reject negative cache size limits#1341
CodingFeng101 wants to merge 1 commit into
scrapinghub:masterfrom
CodingFeng101:codex/reject-negative-cache-size-limit

Conversation

@CodingFeng101

Copy link
Copy Markdown

Summary

Reject negative CACHE_SIZE_LIMIT values during settings validation. The setting is used as a cache-size limit, but negative integers are currently accepted and make the cache eviction condition true immediately after entries are added.

Changes

  • Add a non-negative validation check for CACHE_SIZE_LIMIT.
  • Add a focused regression test for negative values.
  • Keep the existing behavior for 0 and positive limits unchanged.

Validation

  • python -m pytest tests/test_cache_size_limit.py -q -> 1 passed
  • Manual smoke check confirmed CACHE_SIZE_LIMIT values 0 and 1 are still accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant