Skip to content

Commit 8d16b9c

Browse files
committed
Stream dataset file for GitHub release upload
Avoid loading the entire archive into memory by using createReadStream instead of readFileSync. This prevents out-of-memory crashes when publishing large datasets on memory-constrained machines.
1 parent 6155446 commit 8d16b9c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/dataset/publish/github/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default async function publish({ archivePath, releaseDate, stats }) {
3030
logger.info('Uploading release asset…');
3131

3232
await octokit.rest.repos.uploadReleaseAsset({
33-
data: fsApi.readFileSync(archivePath),
33+
data: fsApi.createReadStream(archivePath),
3434
headers: {
3535
'content-type': 'application/zip',
3636
'content-length': fsApi.statSync(archivePath).size,

0 commit comments

Comments
 (0)