Skip to content

Commit

Permalink
chore: try removing stream convertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Shelex committed Dec 16, 2024
1 parent b3a9441 commit 5e50600
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/lib/storage/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { bytesToString } from './format';
import { DATA_FOLDER, REPORTS_FOLDER, REPORTS_PATH, RESULTS_FOLDER, TMP_FOLDER } from './constants';
import { processBatch } from './batch';
import { handlePagination } from './pagination';
import { transformStreamToReadable } from './stream';

import { generatePlaywrightReport } from '@/app/lib/pw';
import { withError } from '@/app/lib/withError';
Expand Down Expand Up @@ -210,9 +209,7 @@ export async function saveResult(stream: ReadableStream<Uint8Array>, size: numbe
const resultID = randomUUID();
const resultPath = path.join(RESULTS_FOLDER, `${resultID}.zip`);

const writeable = createWriteStream(resultPath);

const { error: pipelineError } = await withError(pipeline(transformStreamToReadable(stream), writeable));
const { error: pipelineError } = await withError(pipeline(stream as any, createWriteStream(resultPath)));

if (pipelineError) {
throw new Error(`failed to save result ${resultID}: ${pipelineError.message}`);
Expand Down

0 comments on commit 5e50600

Please sign in to comment.