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 googleapis#1133)
  • Loading branch information
rhodgkins committed Mar 28, 2020
1 parent 3fe40ae commit 2ba1063
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 2ba1063

Please sign in to comment.