Files
cnb/test/keep-file-live.ts

19 lines
837 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { addKeepAliveData, createLiveData, getKeepAliveCache } from '../agent/routes/workspace/keep-file-live';
const repo = 'kevisual/dev-env';
const pipelineId = 'cnb-708-1ji9sog7o-001';
const testData = createLiveData({
wsUrl: "wss://cnb-708-1ji9sog7o-001.cnb.space:443?skipWebSocketFrames=false",
cookie: "orange:workspace:cookie-session:cnb-708-1ji9sog7o-001=3dc03d84-5617-4e44-a6b9-38ce4398aea5",
repo: repo,
pipelineId: pipelineId
});
addKeepAliveData(testData);
// 运行后可以在 ~/.cnb/kevisual_dev-env_cnb-708-1ji9sog7o-001.json 中看到保持存活的数据
// 同时可以通过 pm2 list 命令看到对应的保持存活的进程
// 注意:如果要测试停止保持存活,可以调用 stopLive(testData.pm2Name) 来停止对应的进程
// 例如stopLive('kevisual_dev-env_cnb-708-1ji9sog7o-001');