Skip to content

Commit 56663fb

Browse files
authored
Update getParsedData.ts
1 parent 5b1bf98 commit 56663fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

store/getParsedData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { insertMatch } from './insert';
1111
import redis from './redis';
1212
import axios from 'axios';
1313

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

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

0 commit comments

Comments
 (0)