feat: run to json

This commit is contained in:
karishmas6
2024-10-16 03:15:28 +05:30
parent b3d76ae664
commit 1f11e773e2

View File

@@ -34,13 +34,14 @@ class BinaryOutputService {
* @param binaryOutput - The binary output object containing data to upload. * @param binaryOutput - The binary output object containing data to upload.
* @returns A map of Minio URLs pointing to the uploaded binary data. * @returns A map of Minio URLs pointing to the uploaded binary data.
*/ */
async uploadAndStoreBinaryOutput(run: Run, binaryOutput: Record<string, any>, runId: string): Promise<Record<string, string>> { async uploadAndStoreBinaryOutput(run: Run, binaryOutput: Record<string, any>): Promise<Record<string, string>> {
const uploadedBinaryOutput: Record<string, string> = {}; const uploadedBinaryOutput: Record<string, string> = {};
const plainRun = run.toJSON();
for (const key of Object.keys(binaryOutput)) { for (const key of Object.keys(binaryOutput)) {
let binaryData = binaryOutput[key]; let binaryData = binaryOutput[key];
if (!runId) { if (!plainRun.runId) {
console.error('Run ID is undefined. Cannot upload binary data.'); console.error('Run ID is undefined. Cannot upload binary data.');
continue; continue;
} }
@@ -71,7 +72,7 @@ class BinaryOutputService {
} }
try { try {
const minioKey = `${run.id}/${key}`; const minioKey = `${plainRun.runId}/${key}`;
await run.uploadBinaryOutputToMinioBucket(minioKey, binaryData); await run.uploadBinaryOutputToMinioBucket(minioKey, binaryData);