feat: return result.interpretationInfo from executeRun
This commit is contained in:
@@ -245,23 +245,25 @@ async function createWorkflowAndStoreMetadata(id: string, userId: string) {
|
|||||||
|
|
||||||
async function readyForRunHandler(browserId: string, id: string) {
|
async function readyForRunHandler(browserId: string, id: string) {
|
||||||
try {
|
try {
|
||||||
const interpretation = await executeRun(id);
|
const result = await executeRun(id);
|
||||||
|
|
||||||
if (interpretation) {
|
if (result && result.success) {
|
||||||
logger.log('info', `Interpretation of ${id} succeeded`);
|
logger.log('info', `Interpretation of ${id} succeeded`);
|
||||||
|
return result.interpretationInfo;
|
||||||
} else {
|
} else {
|
||||||
logger.log('error', `Interpretation of ${id} failed`);
|
logger.log('error', `Interpretation of ${id} failed`);
|
||||||
await destroyRemoteBrowser(browserId);
|
await destroyRemoteBrowser(browserId);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
resetRecordingState(browserId, id);
|
|
||||||
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
logger.error(`Error during readyForRunHandler: ${error.message}`);
|
logger.error(`Error during readyForRunHandler: ${error.message}`);
|
||||||
await destroyRemoteBrowser(browserId);
|
await destroyRemoteBrowser(browserId);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function resetRecordingState(browserId: string, id: string) {
|
function resetRecordingState(browserId: string, id: string) {
|
||||||
browserId = '';
|
browserId = '';
|
||||||
id = '';
|
id = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user