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 Apr 30, 2020
1 parent c4a2aed commit 71b2321
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bucket.ts
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 71b2321

Please sign in to comment.