From 1f11e773e2d1f240494b1ad381e0831c20c46550 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 16 Oct 2024 03:15:28 +0530 Subject: [PATCH] feat: run to json --- server/src/storage/mino.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/storage/mino.ts b/server/src/storage/mino.ts index 74d11054..849060b8 100644 --- a/server/src/storage/mino.ts +++ b/server/src/storage/mino.ts @@ -34,13 +34,14 @@ class BinaryOutputService { * @param binaryOutput - The binary output object containing data to upload. * @returns A map of Minio URLs pointing to the uploaded binary data. */ - async uploadAndStoreBinaryOutput(run: Run, binaryOutput: Record, runId: string): Promise> { + async uploadAndStoreBinaryOutput(run: Run, binaryOutput: Record): Promise> { const uploadedBinaryOutput: Record = {}; + const plainRun = run.toJSON(); for (const key of Object.keys(binaryOutput)) { let binaryData = binaryOutput[key]; - if (!runId) { + if (!plainRun.runId) { console.error('Run ID is undefined. Cannot upload binary data.'); continue; } @@ -71,7 +72,7 @@ class BinaryOutputService { } try { - const minioKey = `${run.id}/${key}`; + const minioKey = `${plainRun.runId}/${key}`; await run.uploadBinaryOutputToMinioBucket(minioKey, binaryData);