feat: recording id for shceduled robot

This commit is contained in:
karishmas6
2024-10-08 23:34:53 +05:30
parent 1462ca1f6a
commit f103d84aba

View File

@@ -7,12 +7,23 @@ import { createRemoteBrowserForRun, destroyRemoteBrowser } from '../../browser-m
import logger from '../../logger';
import { browserPool } from "../../server";
import { googleSheetUpdateTasks, processGoogleSheetUpdates } from "../integrations/gsheet";
import { getRecordingByFileName } from "../../routes/storage";
async function runWorkflow(fileName: string, runId: string) {
if (!runId) {
runId = uuid();
}
const recording = await getRecordingByFileName(fileName);
if (!recording || !recording.recording_meta || !recording.recording_meta.id) {
logger.log('info', `Recording with name: ${fileName} not found`);
return {
success: false,
error: `Recording with name: ${fileName} not found`,
};
}
try {
const browserId = createRemoteBrowserForRun({
browser: chromium,
@@ -21,6 +32,7 @@ async function runWorkflow(fileName: string, runId: string) {
const run_meta = {
status: 'Scheduled',
name: fileName,
recordingId: recording.recording_meta.id,
startedAt: new Date().toLocaleString(),
finishedAt: '',
browserId: browserId,