增加错误处理以确保读取剩余时间文件时的稳定性;新增初始化脚本以支持项目启动

This commit is contained in:
xiongxiao
2026-03-18 19:22:46 +08:00
committed by cnb
parent 598737d301
commit e6fb81bcc4
3 changed files with 22 additions and 2 deletions

View File

@@ -37,8 +37,12 @@ export const notify = (content: string) => {
console.log(message); console.log(message);
} }
export const notifyJob = () => { export const notifyJob = () => {
const content = fs.readFileSync(path.join(__dirname, `storage/${groupId}_remains.txt`), 'utf-8'); try {
notify(content); const content = fs.readFileSync(path.join(__dirname, `storage/${groupId}_remains.txt`), 'utf-8');
notify(content);
} catch (error) {
console.error('Failed to read remains file:');
}
} }
const isPm2 = process.env.PM2_HOME !== undefined; const isPm2 = process.env.PM2_HOME !== undefined;

View File

@@ -0,0 +1,8 @@
# 监听minimax的剩余时间定时通知群里
## 说明
环境变量
- `MINIMAX_COOKIE`
- `MINIMAX_GROUP_ID`

8
xiaoxiongmao/init.ts Normal file
View File

@@ -0,0 +1,8 @@
const startList = [
{
cmd: 'bun /workspace/openclaw/skills/cnb-dev-sync/scripts/sync.ts all'
},
{
cmd:"cd /workspace/skills/minimax/listen-cost && pnpm pm2"
}
]