Skip to content

Commit

Permalink
fix(bucket): only disable resumable uploads for bucket.upload when in…
Browse files Browse the repository at this point in the history
…specting the file size (fixes #1133)
  • Loading branch information
rhodgkins committed Apr 23, 2020
1 parent 5caaa0a commit 3948e91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3454,7 +3454,10 @@ class Bucket extends ServiceObject {
return;
}

options.resumable = fd.size > RESUMABLE_THRESHOLD;
if (fd.size <= RESUMABLE_THRESHOLD) {
// Only disable resumable uploads so createWriteStream still attempts them and falls back to simple upload.
options.resumable = false;
}

upload();
});
Expand Down

0 comments on commit 3948e91

Please sign in to comment.