Skip to content

Conversation

@27Bslash6
Copy link
Contributor

REDIS_URL was being ignored because config was read in two places:

  • decorator.py checked REDIS_URL via os.environ.get()
  • RedisBackendConfig used pydantic-settings with CACHEKIT_ prefix

The connection pool always read from RedisBackendConfig.from_env()
which only checked CACHEKIT_REDIS_URL, falling back to localhost:6379.

Fix uses pydantic-settings AliasChoices for proper env var priority:
CACHEKIT_REDIS_URL > REDIS_URL > localhost:6379 (default)

This is the declarative pydantic-settings approach vs manual os.environ.

REDIS_URL was being ignored because config was read in two places:
- decorator.py checked REDIS_URL via os.environ.get()
- RedisBackendConfig used pydantic-settings with CACHEKIT_ prefix

The connection pool always read from RedisBackendConfig.from_env()
which only checked CACHEKIT_REDIS_URL, falling back to localhost:6379.

Fix uses pydantic-settings AliasChoices for proper env var priority:
CACHEKIT_REDIS_URL > REDIS_URL > localhost:6379 (default)

This is the declarative pydantic-settings approach vs manual os.environ.
@27Bslash6 27Bslash6 self-assigned this Dec 18, 2025
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/cachekit/config/decorator.py 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@27Bslash6 27Bslash6 merged commit 274a925 into main Dec 18, 2025
36 of 37 checks passed
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.

2 participants