Skip to content

Commit

Permalink
Update getParsedData.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung authored Nov 19, 2024
1 parent 5b1bf98 commit 56663fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions store/getParsedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { insertMatch } from './insert';
import redis from './redis';
import axios from 'axios';

const blobArchive = new Archive('blob');
const blobArchive = config.ENABLE_BLOB_ARCHIVE ? new Archive('blob') : null;

/**
* Return parse data by reading it without fetching.
Expand All @@ -30,7 +30,7 @@ export async function readParseData(
let data = row?.parsed
? (JSON.parse(row.parsed) as ParserMatch)
: undefined;
if (!data && config.ENABLE_BLOB_ARCHIVE) {
if (!data && blobArchive) {
const archive = await blobArchive.archiveGet(`${matchId}_parsed`);
data = archive ? JSON.parse(archive.toString()) as ParserMatch : undefined;
}
Expand Down

0 comments on commit 56663fb

Please sign in to comment.