feat: add bot control script to prevent multiple instances
Some checks reported errors
continuous-integration/drone/push Build encountered an error

- Add bot_control.sh script for safe bot management
- Prevent 'Conflict: terminated by other getUpdates' error
- Add Makefile commands: bot-start, bot-stop, bot-restart, bot-status, bot-logs
- Add BOT_MANAGEMENT.md with usage instructions
- Use PID file to track single bot instance
- Auto-stop all old processes before starting
- Add .bot.pid to .gitignore

Fixes issue where multiple bot instances cause command processing failures
This commit is contained in:
2025-11-17 06:44:43 +09:00
parent d3f9f2fb53
commit 72e95db811
4 changed files with 293 additions and 1 deletions

View File

@@ -68,6 +68,22 @@ run:
@echo "🚀 Запуск бота..."
. .venv/bin/activate && python main.py
# Управление ботом через скрипт (безопасный запуск одного экземпляра)
bot-start:
@./bot_control.sh start
bot-stop:
@./bot_control.sh stop
bot-restart:
@./bot_control.sh restart
bot-status:
@./bot_control.sh status
bot-logs:
@./bot_control.sh logs
# Создание миграции
migration:
@echo "📄 Создание новой миграции..."