diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-03 14:00:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-03 14:01:38 +0100 |
commit | 6d472b4046084e5f477124b11ac62dca9f6a1a63 (patch) | |
tree | d00c0223b92d8f77e68d46f7bc9e861725172b8e /server/lib/uploadx.ts | |
parent | 390366472d7239864060753c63513d0f316ca468 (diff) | |
download | PeerTube-6d472b4046084e5f477124b11ac62dca9f6a1a63.tar.gz PeerTube-6d472b4046084e5f477124b11ac62dca9f6a1a63.tar.zst PeerTube-6d472b4046084e5f477124b11ac62dca9f6a1a63.zip |
Decrease time to cleanup resumable uploads
Diffstat (limited to 'server/lib/uploadx.ts')
-rw-r--r-- | server/lib/uploadx.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/lib/uploadx.ts b/server/lib/uploadx.ts new file mode 100644 index 000000000..11b1044db --- /dev/null +++ b/server/lib/uploadx.ts | |||
@@ -0,0 +1,10 @@ | |||
1 | import express from 'express' | ||
2 | import { getResumableUploadPath } from '@server/helpers/upload' | ||
3 | import { Uploadx } from '@uploadx/core' | ||
4 | |||
5 | const uploadx = new Uploadx({ directory: getResumableUploadPath() }) | ||
6 | uploadx.getUserId = (_, res: express.Response) => res.locals.oauth?.token.user.id | ||
7 | |||
8 | export { | ||
9 | uploadx | ||
10 | } | ||