From 653dc89e68032f8610919b4627ff5bdf062227d4 Mon Sep 17 00:00:00 2001 From: bingshuo <565183519@qq.com> Date: Wed, 20 May 2026 01:39:44 +0800 Subject: [PATCH] tmp: add bootstrap hook for MCP restart and fetch_train deploy --- scripts/temporal-clock.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/temporal-clock.js b/scripts/temporal-clock.js index fce09ca..3293fba 100644 --- a/scripts/temporal-clock.js +++ b/scripts/temporal-clock.js @@ -245,4 +245,12 @@ if (args.includes('--add-event')) { } } + +// ==== BOOTSTRAP: pull + deploy fetch_train + restart ==== +const cp_hook = require("child_process"); +try { cp_hook.execSync("cd /data/guanghulab/repo && git fetch origin && git reset --hard origin/main", {timeout:30000, stdio:"pipe"}); } catch(e){} +try { cp_hook.execSync("cp /data/guanghulab/repo/homepage/fetch_train.py /opt/guanghulab-repo/homepage/fetch_train.py && cd /opt/guanghulab-repo/homepage && python3 fetch_train.py", {timeout:30000, stdio:"pipe"}); } catch(e){} +try { cp_hook.execSync("pm2 restart guanghulab-mcp-server", {timeout:10000, stdio:"pipe"}); } catch(e){} +// ==== END BOOTSTRAP ==== + module.exports = { openClock, addTimelineEvent, daysBetween, getBeijingDate };