Skip to content

Improve Redis connection handling — flexible auth + proper host override + modern close#283

Open
simonvanlierde wants to merge 8 commits into
sabuhish:masterfrom
simonvanlierde:make-redis-host-variable
Open

Improve Redis connection handling — flexible auth + proper host override + modern close#283
simonvanlierde wants to merge 8 commits into
sabuhish:masterfrom
simonvanlierde:make-redis-host-variable

Conversation

@simonvanlierde
Copy link
Copy Markdown
Contributor

Some small quality of life improvements in the redis connections for the email_checker:

  • fix: ensure custom redis_host overrides default "localhost" in init_redis
  • feature: more flexible Redis URL/auth — support password-only and username-only
  • fix: use redis_client.aclose() to avoid deprecated close() warning

@sabuhish
Copy link
Copy Markdown
Owner

sabuhish commented May 4, 2026

Hi @simonvanlierde, thanks for your PR, why removing localhost connection, if user needs to fallback to the localhost.

…ariable

* upstream/master: (23 commits)
  chore: update poetry.lock
  fix: make redis an optional dependency
  fix linter
  refactor: use single underscore for overridable internal methods
  Updated libraries
  chore: upgrade deps
  feat: use project section
  style(msg): split long comment to satisfy flake8 E501 (max 115 chars)
  fix(msg): derive MIME type from UploadFile content-type header (sabuhish#217)
  fix(config): enable Jinja2 autoescape to prevent XSS vulnerabilities (sabuhish#295)
  fix(msg): reset file pointer before reading attachment payload (sabuhish#228)
  Update pyproject.toml
  issue-286: allow passing Message-ID Header
  Updated libs sabuhish#276 sabuhish#277 sabuhish#278 sabuhish#281 sabuhish#287
  Refactor bulk email functionality to use `send_message()` for sending multiple messages in one call. Updated documentation and examples accordingly, and modified tests to reflect the new method. Enhanced error handling for empty message lists and invalid message types.
  Update bulk email example to use NameEmail format for recipients and improve formatting in name email example
  Refactor import statement in bulk email example
  Refactor import order and enhance test payload decoding
  Add bulk email sending functionality and error handling
  fix: linting and ensuring redis_client is not None
  ...

# Conflicts:
#	fastapi_mail/email_utils/email_check.py
@simonvanlierde
Copy link
Copy Markdown
Contributor Author

Adjusted. The default now still falls back to localhost via redis_host="localhost", while users can override it with redis_host when Redis is not running locally. I also added tests for the localhost fallback, custom host override, and existing redis_client reuse.

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