diff --git a/agent/routes/workspace/keep.ts b/agent/routes/workspace/keep.ts index 009334e..797df80 100644 --- a/agent/routes/workspace/keep.ts +++ b/agent/routes/workspace/keep.ts @@ -40,7 +40,7 @@ app.route({ console.log(`启动保持工作空间 ${wsUrl} 存活的任务`); - const config: KeepAliveData = createLiveData({ wsUrl, cookie, repo, pipelineId }); + const config: KeepAliveData = createLiveData({ cookie, repo, pipelineId }); addKeepAliveData(config); ctx.body = { content: `已启动保持工作空间 ${wsUrl} 存活的任务`, data: config }; diff --git a/package.json b/package.json index 32df798..51cee99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/cnb", - "version": "0.0.30", + "version": "0.0.31", "description": "", "main": "index.js", "scripts": { diff --git a/src/workspace/keep-file-live.ts b/src/workspace/keep-file-live.ts index 95bf286..f544b33 100644 --- a/src/workspace/keep-file-live.ts +++ b/src/workspace/keep-file-live.ts @@ -104,9 +104,10 @@ export function removeKeepAliveData(repo: string, pipelineId: string): KeepAlive } } -export const createLiveData = (data: { wsUrl: string, cookie: string, repo: string, pipelineId: string }): KeepAliveData => { - const { wsUrl, cookie, repo, pipelineId } = data; +export const createLiveData = (data: { cookie: string, repo: string, pipelineId: string }): KeepAliveData => { + const { cookie, repo, pipelineId } = data; const createdTime = Date.now(); + const wsUrl = `wss://${pipelineId}.cnb.space:443?skipWebSocketFrames=false`; const pm2Name = `${repo}__${pipelineId}`.replace(/\//g, '__'); const filePath = path.join(os.homedir(), '.cnb', `${pm2Name}.json`); const _newData = { wss: wsUrl, wsUrl, cookie, repo, pipelineId, createdTime, filePath, pm2Name }; @@ -125,8 +126,8 @@ export class KeepAliveManager { static add(data: KeepAliveData) { return addKeepAliveData(data); } - - static createLiveData(data: { wsUrl: string, cookie: string, repo: string, pipelineId: string }): KeepAliveData { + + static createLiveData(data: { cookie: string, repo: string, pipelineId: string }): KeepAliveData { return createLiveData(data); }