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:
@@ -12,7 +12,6 @@ from helper_bot.main import start_bot
|
||||
from helper_bot.utils.base_dependency_factory import get_global_instance
|
||||
from helper_bot.server_monitor import ServerMonitor
|
||||
from helper_bot.utils.auto_unban_scheduler import get_auto_unban_scheduler
|
||||
from helper_bot.utils.metrics_exporter import MetricsManager
|
||||
|
||||
|
||||
async def start_monitoring(bdf, bot):
|
||||
@@ -47,7 +46,9 @@ async def main():
|
||||
auto_unban_scheduler.set_bot(monitor_bot)
|
||||
auto_unban_scheduler.start_scheduler()
|
||||
|
||||
# Инициализируем метрики
|
||||
# Инициализируем метрики ПОСЛЕ импорта всех модулей
|
||||
# Это гарантирует, что global instance полностью инициализирован
|
||||
from helper_bot.utils.metrics_exporter import MetricsManager
|
||||
metrics_manager = MetricsManager(host="0.0.0.0", port=8000)
|
||||
|
||||
# Флаг для корректного завершения
|
||||
|
||||
Reference in New Issue
Block a user