diff --git a/github_webhook_updater.py b/github_webhook_updater.py index f12548f..a5fa768 100644 --- a/github_webhook_updater.py +++ b/github_webhook_updater.py @@ -82,9 +82,9 @@ def pull_and_restart(changed_files: list[str]) -> tuple[bool, str]: # Determine which processes to restart based on changed files processes_to_restart = [] - # Bot: restart if SREBOT/BOT/, SHARED/, SREBOT/start_bot.py, ecosystem.config.js, - # or SREBOT root .py files changed - bot_changed = any( + # SREBOT bot: restart if SREBOT/BOT/, SHARED/, SREBOT/start_bot.py, + # SREBOT/ecosystem.config.js, or SREBOT root .py files changed. + srebot_changed = any( f.startswith('SREBOT/BOT/') or f.startswith('SHARED/') or f == 'SREBOT/start_bot.py' @@ -92,9 +92,23 @@ def pull_and_restart(changed_files: list[str]) -> tuple[bool, str]: or (f.startswith('SREBOT/') and f.endswith('.py') and f.count('/') == 1 and not f.endswith('/' + WEBHOOK_FILENAME)) for f in changed_files ) - if bot_changed: + if srebot_changed: processes_to_restart.append('srebot') - logger.info("Bot files changed, will restart srebot") + logger.info("SREBOT files changed, will restart srebot") + + # TSSBOT bot: restart if TSSBOT/BOT/, TSSBOT/start_bot.py, + # TSSBOT/ecosystem.config.js, SHARED/, or TSSBOT root .py files changed. + tssbot_changed = any( + f.startswith('TSSBOT/BOT/') + or f.startswith('SHARED/') + or f == 'TSSBOT/start_bot.py' + or f == 'TSSBOT/ecosystem.config.js' + or (f.startswith('TSSBOT/') and f.endswith('.py') and f.count('/') == 1) + for f in changed_files + ) + if tssbot_changed: + processes_to_restart.append('tssbot') + logger.info("TSSBOT files changed, will restart tssbot") # API server: restart if SREBOT/server.js changed api_changed = any(f == 'SREBOT/server.js' for f in changed_files)