Skip to content

Commit

Permalink
@uppy/companion: make streaming upload default to true (#5315)
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi authored Jul 10, 2024
1 parent f10256c commit 682de7a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 2 additions & 4 deletions docs/companion.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ const options = {
allowLocalUrls: false,
logClientVersion: true,
periodicPingUrls: [],
streamingUpload: false,
streamingUpload: true,
clientSocketConnectTimeout: 60000,
metrics: true,
};
Expand Down Expand Up @@ -600,9 +600,7 @@ Prometheus metrics (by default metrics are enabled.)
A boolean flag to tell Companion whether to enable streaming uploads. If
enabled, it will lead to _faster uploads_ because companion will start uploading
at the same time as downloading using `stream.pipe`. If `false`, files will be
fully downloaded first, then uploaded. Defaults to `false`, but we recommended
enabling it, especially if you’re expecting to upload large files. In future
versions the default might change to `true`.
fully downloaded first, then uploaded. Defaults to `true`.

#### `maxFileSize` `COMPANION_MAX_FILE_SIZE`

Expand Down
2 changes: 2 additions & 0 deletions docs/guides/migration-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ These cover all the major Uppy versions and how to migrate to them.
- The URL endpoint (used by the `Url`/`Link` plugin) is now turned off by
default and must be explicitly enabled with
`COMPANION_ENABLE_URL_ENDPOINT=true` or `enableUrlEndpoint: true`.
- The option `streamingUpload` / `COMPANION_STREAMING_UPLOAD` now defaults to
`true`.
- The option `getKey(req, filename, metadata)` has changed signature to
`getKey({ filename, metadata, req })`.
- The option `bucket(req, metadata)` has changed signature to
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/companion/src/config/companion.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const defaultOptions = {
enableUrlEndpoint: false,
allowLocalUrls: false,
periodicPingUrls: [],
streamingUpload: false,
streamingUpload: true,
clientSocketConnectTimeout: 60000,
metrics: true,
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/companion/src/standalone/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const getConfigFromEnv = () => {
allowLocalUrls: process.env.COMPANION_ALLOW_LOCAL_URLS === 'true',
// cookieDomain is kind of a hack to support distributed systems. This should be improved but we never got so far.
cookieDomain: process.env.COMPANION_COOKIE_DOMAIN,
streamingUpload: process.env.COMPANION_STREAMING_UPLOAD === 'true',
streamingUpload: process.env.COMPANION_STREAMING_UPLOAD ? process.env.COMPANION_STREAMING_UPLOAD === 'true' : undefined,
maxFileSize: process.env.COMPANION_MAX_FILE_SIZE ? parseInt(process.env.COMPANION_MAX_FILE_SIZE, 10) : undefined,
chunkSize: process.env.COMPANION_CHUNK_SIZE ? parseInt(process.env.COMPANION_CHUNK_SIZE, 10) : undefined,
clientSocketConnectTimeout: process.env.COMPANION_CLIENT_SOCKET_CONNECT_TIMEOUT
Expand Down

0 comments on commit 682de7a

Please sign in to comment.