auto-sync: 2026-04-05 17:32:06
This commit is contained in:
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Sanguo Mail 系统健康检查脚本
|
||||
* 定期检查系统状态,确保邮件功能正常
|
||||
*/
|
||||
|
||||
import { SanguoMailbox } from '../sanguo_mail/src/index.js';
|
||||
import { join } from 'path';
|
||||
|
||||
const CONFIG = {
|
||||
rootPath: '/Users/chufeng/.openclaw/sanguo_projects/sanguo_quant_live',
|
||||
teamName: 'sanguo-quant',
|
||||
};
|
||||
|
||||
async function checkSystem() {
|
||||
console.log('[Health Check] 开始系统健康检查...');
|
||||
|
||||
try {
|
||||
const mail = new SanguoMailbox(CONFIG);
|
||||
|
||||
// 检查团队配置
|
||||
const team = await mail.initTeam();
|
||||
console.log(`[Health Check] 团队配置正常: ${team.teamName}`);
|
||||
|
||||
// 检查成员列表
|
||||
if (team.members.length === 0) {
|
||||
console.error('[Health Check] 错误: 团队成员为空');
|
||||
return 1;
|
||||
}
|
||||
console.log(`[Health Check] 成员数量: ${team.members.length}`);
|
||||
|
||||
// 检查邮件功能
|
||||
const myInbox = await mail.listUnread('jiangwei');
|
||||
console.log(`[Health Check] 收件箱: ${myInbox.length} 条未读消息`);
|
||||
|
||||
console.log('[Health Check] 系统健康检查完成');
|
||||
return 0;
|
||||
} catch (error) {
|
||||
console.error('[Health Check] 系统健康检查失败:', error.message);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
checkSystem().then(process.exit);
|
||||
Reference in New Issue
Block a user