feat: add bot control script to prevent multiple instances
Some checks reported errors
continuous-integration/drone/push Build encountered an error
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:
16
Makefile
16
Makefile
@@ -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 "📄 Создание новой миграции..."
|
||||
|
||||
Reference in New Issue
Block a user