-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add asynchronous support to ip restriction middleware #3831
base: main
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨ |
User description
👋 Hi there! This PR was automatically generated by Autofix 🤖
This fix was triggered by DB
Fixes BLT-DJANGO-1EK
asgiref.sync.sync_to_async
for compatibility with asynchronous views.__acall__
method to handle requests asynchronously.If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID: 8427.
PR Type
Enhancement
Description
Added asynchronous support to IP restriction middleware.
Implemented
__acall__
method for async request handling.Created async helper functions for IP recording and block count increment.
Refactored synchronous logic for better compatibility and maintainability.
Changes walkthrough 📝
ip_restrict.py
Added async support and refactored middleware logic
blt/middleware/ip_restrict.py
increment.
__acall__
method for handling async requests.sync_to_async
for compatibility with async views.