OpenClaw 的飞书通道每分钟会执行一次健康检查,调用 probeFeishu() 函数获取机器人信息。如果没有缓存机制,每月会产生约 43,200 次 API 调用,远超飞书免费配额的 10,000 次/月。
郑工长的优化方案添加了缓存机制:
问题:每次 OpenClaw 升级都会覆盖 probe.ts 文件,导致优化失效。
本技能提供自动检查和修复功能:
probe.ts 的缓存配置是否为 60 分钟node ~/.openclaw/workspace/skills/feishu-cache-guardian/scripts/check-and-fix.js
使用 OpenClaw 的 cron 功能,每天检查一次:
openclaw cron add \
--name "feishu-cache-check" \
--schedule "0 9 * * *" \
--command "node ~/.openclaw/workspace/skills/feishu-cache-guardian/scripts/check-and-fix.js"
或在升级后立即检查:
openclaw cron add \
--name "feishu-cache-post-upgrade" \
--schedule "@reboot" \
--command "sleep 30 && node ~/.openclaw/workspace/skills/feishu-cache-guardian/scripts/check-and-fix.js"
scripts/check-and-fix.js/opt/homebrew/lib/node_modules/openclaw/extensions/feishu/src/probe.ts修改的内容:
// 修改前(默认)
const PROBE_SUCCESS_TTL_MS = 10 * 60 * 1000; // 10 minutes
const PROBE_ERROR_TTL_MS = 60 * 1000; // 1 minute
// 修改后(优化)
const PROBE_SUCCESS_TTL_MS = 60 * 60 * 1000; // 60 minutes
const PROBE_ERROR_TTL_MS = 60 * 60 * 1000; // 60 minutes
共 1 个版本