From 36f9277db7cb3cd8ed61d270c3b36b4b38c5e188 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 16 Oct 2024 01:25:57 +0530 Subject: [PATCH] feat: hande data as per interpreter --- server/src/storage/mino.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/storage/mino.ts b/server/src/storage/mino.ts index 8c6e9b54..26709768 100644 --- a/server/src/storage/mino.ts +++ b/server/src/storage/mino.ts @@ -40,13 +40,14 @@ class BinaryOutputService { for (const key of Object.keys(binaryOutput)) { let binaryData = binaryOutput[key]; + // Log the key and data console.log(`Processing binary output key: ${key}`); console.log(`Binary data:`, binaryData); - // If the binary data is a string, try parsing it as JSON - if (typeof binaryData === 'string') { + // Check if binaryData is an object with a "data" field (containing the Buffer string) + if (binaryData && typeof binaryData.data === 'string') { try { - const parsedData = JSON.parse(binaryData); + const parsedData = JSON.parse(binaryData.data); // Check if the parsed data has the "type" and "data" fields if (parsedData && parsedData.type === 'Buffer' && Array.isArray(parsedData.data)) { @@ -85,6 +86,7 @@ class BinaryOutputService { } } + // Log the binary output after processing console.log('Uploaded Binary Output:', uploadedBinaryOutput); // Update the run with the Minio URLs for binary output