Skip to content

Commit 75a5164

Browse files
authored
Update getGcData.ts
1 parent 559b9be commit 75a5164

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

store/getGcData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type GcExtraData = {
1818
pgroup: PGroup;
1919
};
2020

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

2323
/**
2424
* Return GC data by reading it without fetching.
@@ -33,7 +33,7 @@ export async function readGcData(matchId: number): Promise<GcMatch | null> {
3333
);
3434
const row = result.rows[0];
3535
let gcData = row?.gcdata ? (JSON.parse(row.gcdata) as GcMatch) : undefined;
36-
if(!gcData && config.ENABLE_BLOB_ARCHIVE) {
36+
if(!gcData && blobArchive) {
3737
const archive = await blobArchive.archiveGet(`${matchId}_gcdata`);
3838
gcData = archive ? JSON.parse(archive.toString()) as GcMatch : undefined;
3939
}

0 commit comments

Comments
 (0)