TTeamDesk 学习手册

scripts/worker-health.ts

此代码来自构建时的仓库快照。修改源码后重新构建即可更新。

ts
import 'dotenv/config';
import { heartbeatScope } from '../src/server/jobs/heartbeat';
import { queueHealth } from '../src/server/jobs/health';
async function main() {
  // 独立短进程检查当前作用域的有效登记;同作用域至少一个进程可接工作才算健康。
  const timeout = setTimeout(() => {
    process.exit(1);
  }, 4000);
  try {
    const health = await queueHealth(heartbeatScope());
    process.exitCode = health.redis && health.worker ? 0 : 1;
  } catch {
    process.exitCode = 1;
  } finally {
    clearTimeout(timeout);
  }
}
void main();

搜索教程

输入关键词,搜索全部章节。

阅读设置

外观
正文字号

从一张工单出发,读懂数据如何流转。

设置与进度仅保存在当前浏览器。