**Describe the bug or question** A clear and concise description of what the bug or question is. **To Reproduce** Please provide a self-contained, minimal, and reproducible example of your use case ```python async def is_rate_limited(db: AsyncSession, user_id: int, path: str, limit: int, period: int) -> bool: if client is None: logger.error("Redis client is not initialized.") raise Exception("Redis client is not initialized.") ``` **Description** Redis client was recognised as none when I tried to create background tasks in Swagger and caught exception in `is_rate_limited` **Screenshots** <img width="1449" alt="Screenshot 2024-09-08 at 5 12 24 PM" src="https://github.com/user-attachments/assets/5869a3b0-da4a-45d0-a1f0-8c041294f575"> <img width="1415" alt="Screenshot 2024-09-08 at 5 12 36 PM" src="https://github.com/user-attachments/assets/ea0f40a6-276a-4ece-a273-e722d42591c0"> <img width="973" alt="Screenshot 2024-09-08 at 5 14 44 PM" src="https://github.com/user-attachments/assets/be9530cc-1f01-4b75-9f68-ef3dee14e063"> **Additional context** Add any other context about the problem here.