feat: use id in readyForRunHandler

This commit is contained in:
karishmas6
2024-10-10 03:03:14 +05:30
parent 9d9db067a9
commit 2cc07d545c

View File

@@ -146,18 +146,18 @@ async function executeRun(id: string) {
} }
} }
async function readyForRunHandler(browserId: string, fileName: string, runId: string) { async function readyForRunHandler(browserId: string, id: string) {
try { try {
const interpretation = await executeRun(fileName, runId); const interpretation = await executeRun(id);
if (interpretation) { if (interpretation) {
logger.log('info', `Interpretation of ${fileName} succeeded`); logger.log('info', `Interpretation of ${id} succeeded`);
} else { } else {
logger.log('error', `Interpretation of ${fileName} failed`); logger.log('error', `Interpretation of ${id} failed`);
await destroyRemoteBrowser(browserId); await destroyRemoteBrowser(browserId);
} }
resetRecordingState(browserId, fileName, runId); resetRecordingState(browserId, id);
} catch (error: any) { } catch (error: any) {
logger.error(`Error during readyForRunHandler: ${error.message}`); logger.error(`Error during readyForRunHandler: ${error.message}`);
@@ -165,11 +165,9 @@ async function readyForRunHandler(browserId: string, fileName: string, runId: st
} }
} }
function resetRecordingState(browserId: string, fileName: string, runId: string) { function resetRecordingState(browserId: string, id: string) {
browserId = ''; browserId = '';
fileName = ''; id = '';
runId = '';
logger.log(`info`, `reset values for ${browserId}, ${fileName}, and ${runId}`);
} }
export async function handleRunRecording(fileName: string, runId: string) { export async function handleRunRecording(fileName: string, runId: string) {