Skip to content

fix: replace blocking Redis client with async implementation#169

Open
Prinxeeee wants to merge 1 commit into
istSOS:mainfrom
Prinxeeee:use-async-redis
Open

fix: replace blocking Redis client with async implementation#169
Prinxeeee wants to merge 1 commit into
istSOS:mainfrom
Prinxeeee:use-async-redis

Conversation

@Prinxeeee
Copy link
Copy Markdown
Contributor

Use async Redis client for non-blocking operations

Problem
The synchronous redis.Redis client was blocking the asyncio event loop on every token check and cache update, stalling concurrent requests.

Changes

  • redis_db.py: switched to redis.asyncio.Redis and made remove_cache async
  • login.py: added await to all Redis calls

Bonus fix

  • fixed duplicate revocation check in /Refresh (was checking the same condition twice)

Notes

  • Existing behavior is preserved (TTL handling and token revocation logic unchanged)
  • Import name redis is kept to avoid a larger diff across the codebase

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