Skip to content
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

Inject aiogram handlers once #336

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

Olegt0rr
Copy link
Contributor

The current implementation of setup_dishka (with autoinject enabled) uses AutoInjectMiddleware which does an inject at application runtime each time a handler is called. Which does unnecessary work and slows down the execution of the original handler.

I refined setup_dishka so that inject is done for each handler only once, at application startup.

For users who use AutoInjectMiddleware directly, I added a warning with a recommendation to switch to a more productive way of working.

@Tishka17 Tishka17 merged commit bb5335f into reagento:develop Jan 10, 2025
4 checks passed
@Olegt0rr Olegt0rr deleted the feature/aiogram-inject-once branch January 10, 2025 21:23
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