chore: -rm comments
This commit is contained in:
@@ -45,18 +45,15 @@ worker.on('failed', (job: any, err) => {
|
|||||||
|
|
||||||
async function runWorkflow(fileName: string, runId: string) {
|
async function runWorkflow(fileName: string, runId: string) {
|
||||||
try {
|
try {
|
||||||
// Create a browser for the run
|
|
||||||
const browserId = createRemoteBrowserForRun({
|
const browserId = createRemoteBrowserForRun({
|
||||||
browser: chromium,
|
browser: chromium,
|
||||||
launchOptions: { headless: true }
|
launchOptions: { headless: true }
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create a unique runId if not provided
|
|
||||||
if (!runId) {
|
if (!runId) {
|
||||||
runId = uuid();
|
runId = uuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up run metadata
|
|
||||||
const run_meta = {
|
const run_meta = {
|
||||||
status: 'RUNNING',
|
status: 'RUNNING',
|
||||||
name: fileName,
|
name: fileName,
|
||||||
@@ -70,16 +67,12 @@ async function runWorkflow(fileName: string, runId: string) {
|
|||||||
runId: runId,
|
runId: runId,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Ensure directory exists
|
|
||||||
fs.mkdirSync('../storage/runs', { recursive: true });
|
fs.mkdirSync('../storage/runs', { recursive: true });
|
||||||
|
|
||||||
// Save the run metadata to a file
|
|
||||||
await saveFile(
|
await saveFile(
|
||||||
`../storage/runs/${fileName}_${runId}.json`,
|
`../storage/runs/${fileName}_${runId}.json`,
|
||||||
JSON.stringify(run_meta, null, 2)
|
JSON.stringify(run_meta, null, 2)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Log creation of the run
|
|
||||||
logger.log('debug', `Scheduled run with name: ${fileName}.json`);
|
logger.log('debug', `Scheduled run with name: ${fileName}.json`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user