Skip to content

Commit

Permalink
only cancel the request stream when the lock is cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
fenos committed Nov 27, 2023
2 parents a4edaf0 + 6cf2786 commit 1d42e88
Show file tree
Hide file tree
Showing 21 changed files with 1,073 additions and 483 deletions.
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ plugins:
spec: "@yarnpkg/plugin-typescript"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.2.3.cjs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ The tus protocol supports optional [extensions][]. Below is a table of the suppo
| ------------------------ | --------------------------------- | ----------------------------- | ------------------------------- |
| [Creation][] ||||
| [Creation With Upload][] ||||
| [Expiration][] || ||
| [Expiration][] || ||
| [Checksum][] ||||
| [Termination][] ||||
| [Concatenation][] ||||
Expand Down
30 changes: 29 additions & 1 deletion packages/s3-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The tus protocol supports optional [extensions][]. Below is a table of the suppo
| ------------------------ | --------------- |
| [Creation][] ||
| [Creation With Upload][] ||
| [Expiration][] | |
| [Expiration][] | |
| [Checksum][] ||
| [Termination][] ||
| [Concatenation][] ||
Expand All @@ -88,6 +88,32 @@ The tus protocol supports optional [extensions][]. Below is a table of the suppo

After a multipart upload is aborted, no additional parts can be uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if any part uploads are currently in progress, those part uploads might or might not succeed. As a result, it might be necessary to set an [S3 Lifecycle configuration](https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpu-abort-incomplete-mpu-lifecycle-config.html) to abort incomplete multipart uploads.

### Expiration

Unlike other stores, the expiration extension on the S3 store does not need to call [`server.cleanUpExpiredUploads()`][cleanExpiredUploads].
The store creates a `Tus-Complete` tag for all objects, including `.part` and `.info` files, to indicate whether an upload is finished.
This means you could setup a [lifecyle][] policy to automatically clean them up without a CRON job.

```json
{
"Rules": [
{
"Filter": {
"Tag": {
"Key": "Tus-Complete",
"Value": "false"
}
},
"Expiration": {
"Days": 2
}
}
]
}
```

If you want more granularity, it is still possible to configure a CRON job to call [`server.cleanExpiredUploads()`][cleanExpiredUploads] yourself.

## Examples

### Example: using `credentials` to fetch credentials inside a AWS container
Expand Down Expand Up @@ -137,3 +163,5 @@ See [`contributing.md`](https://github.com/tus/tus-node-server/blob/main/.github
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
[termination]: https://tus.io/protocols/resumable-upload.html#termination
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
[cleanExpiredUploads]: https://github.com/tus/tus-node-server/tree/main/packages/server#servercleanupexpireduploads
[lifecyle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html
Loading

0 comments on commit 1d42e88

Please sign in to comment.