mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-05-21 23:24:44 +02:00
Fix healthcheck to verify PID and add DM-only conversational mode
- 6a: Change healthcheck in Dockerfile and docker-compose.yml to verify the PID file exists and the process is alive (kill -0) instead of testing SQLite connectivity, which only proves the DB file exists - 6b: In DMs, skip !commands so MeshMonitor or other bots handle them. MeshAI only responds conversationally in DMs (no bang commands) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
32cd2b3427
commit
ab7e52b9fb
3 changed files with 6 additions and 7 deletions
|
|
@ -74,9 +74,9 @@ VOLUME ["/data"]
|
|||
# Expose ttyd web config port
|
||||
EXPOSE 7682
|
||||
|
||||
# Health check
|
||||
# Health check - verify bot process is alive via PID file
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
||||
CMD python -c "import sqlite3; sqlite3.connect('/data/conversations.db').execute('SELECT 1')" || exit 1
|
||||
CMD test -f /tmp/meshai.pid && kill -0 $(cat /tmp/meshai.pid) 2>/dev/null || exit 1
|
||||
|
||||
# Entrypoint handles config and ttyd
|
||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ services:
|
|||
memory: 64M
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import sqlite3; sqlite3.connect('/data/conversations.db').execute('SELECT 1')"]
|
||||
test: ["CMD-SHELL", "test -f /tmp/meshai.pid && kill -0 $(cat /tmp/meshai.pid) 2>/dev/null || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
|
|
|||
|
|
@ -80,12 +80,11 @@ class MessageRouter:
|
|||
if message.sender_id == self.connector.my_node_id:
|
||||
return False
|
||||
|
||||
# Check if DM
|
||||
# Check if DM — conversational mode only, skip !commands
|
||||
# (let MeshMonitor or other bots handle bang commands in DMs)
|
||||
if message.is_dm:
|
||||
# In DMs, let commands through to dispatcher but skip !commands
|
||||
# that should be handled by other bots (like MeshMonitor)
|
||||
if self.dispatcher.is_command(message.text):
|
||||
return True
|
||||
return False
|
||||
return self.config.bot.respond_to_dms
|
||||
|
||||
# Check channel filtering
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue