Refactor Docker and configuration files for improved structure and functionality
- Updated `.dockerignore` to include additional development and temporary files, enhancing build efficiency. - Modified `.gitignore` to remove unnecessary entries and streamline ignored files. - Enhanced `docker-compose.yml` with health checks, resource limits, and improved environment variable handling for better service management. - Refactored `Dockerfile.bot` to utilize a multi-stage build for optimized image size and security. - Improved `Makefile` with new commands for deployment, migration, and backup, along with enhanced help documentation. - Updated `requirements.txt` to include new dependencies for environment variable management. - Refactored metrics handling in the bot to ensure proper initialization and collection.
This commit is contained in:
@@ -25,6 +25,12 @@ async def start_bot(bdf):
|
||||
dp.update.outer_middleware(MetricsMiddleware())
|
||||
dp.update.outer_middleware(BlacklistMiddleware())
|
||||
|
||||
# Добавляем middleware напрямую к роутерам для тестирования
|
||||
admin_router.message.middleware(MetricsMiddleware())
|
||||
private_router.message.middleware(MetricsMiddleware())
|
||||
callback_router.callback_query.middleware(MetricsMiddleware())
|
||||
group_router.message.middleware(MetricsMiddleware())
|
||||
|
||||
dp.include_routers(admin_router, private_router, callback_router, group_router)
|
||||
await bot.delete_webhook(drop_pending_updates=True)
|
||||
await dp.start_polling(bot, skip_updates=True)
|
||||
|
||||
Reference in New Issue
Block a user