feat: use id
This commit is contained in:
@@ -170,9 +170,9 @@ function resetRecordingState(browserId: string, id: string) {
|
|||||||
id = '';
|
id = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function handleRunRecording(fileName: string, runId: string) {
|
export async function handleRunRecording(id: string) {
|
||||||
try {
|
try {
|
||||||
const result = await runWorkflow(fileName, runId);
|
const result = await runWorkflow(id);
|
||||||
const { browserId, runId: newRunId } = result;
|
const { browserId, runId: newRunId } = result;
|
||||||
|
|
||||||
if (!browserId || !newRunId) {
|
if (!browserId || !newRunId) {
|
||||||
@@ -184,9 +184,9 @@ export async function handleRunRecording(fileName: string, runId: string) {
|
|||||||
rejectUnauthorized: false
|
rejectUnauthorized: false
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('ready-for-run', () => readyForRunHandler(browserId, fileName, newRunId));
|
socket.on('ready-for-run', () => readyForRunHandler(browserId, newRunId));
|
||||||
|
|
||||||
logger.log('info', `Running recording: ${fileName}`);
|
logger.log('info', `Running recording: ${id}`);
|
||||||
|
|
||||||
socket.on('disconnect', () => {
|
socket.on('disconnect', () => {
|
||||||
cleanupSocketListeners(socket, browserId, newRunId);
|
cleanupSocketListeners(socket, browserId, newRunId);
|
||||||
@@ -197,9 +197,9 @@ export async function handleRunRecording(fileName: string, runId: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanupSocketListeners(socket: Socket, browserId: string, runId: string) {
|
function cleanupSocketListeners(socket: Socket, browserId: string, id: string) {
|
||||||
socket.off('ready-for-run', () => readyForRunHandler(browserId, '', runId));
|
socket.off('ready-for-run', () => readyForRunHandler(browserId, id));
|
||||||
logger.log('info', `Cleaned up listeners for browserId: ${browserId}, runId: ${runId}`);
|
logger.log('info', `Cleaned up listeners for browserId: ${browserId}, runId: ${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export { runWorkflow };
|
export { runWorkflow };
|
||||||
Reference in New Issue
Block a user