From 6d472b4046084e5f477124b11ac62dca9f6a1a63 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Dec 2021 14:00:40 +0100 Subject: Decrease time to cleanup resumable uploads --- server/controllers/api/videos/upload.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/videos/upload.ts b/server/controllers/api/videos/upload.ts index 6773b500f..c827f6bf0 100644 --- a/server/controllers/api/videos/upload.ts +++ b/server/controllers/api/videos/upload.ts @@ -8,6 +8,7 @@ import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' import { generateWebTorrentVideoFilename } from '@server/lib/paths' import { Redis } from '@server/lib/redis' +import { uploadx } from '@server/lib/uploadx' import { addMoveToObjectStorageJob, addOptimizeOrMergeAudioJob, @@ -19,7 +20,6 @@ import { VideoPathManager } from '@server/lib/video-path-manager' import { buildNextVideoState } from '@server/lib/video-state' import { openapiOperationDoc } from '@server/middlewares/doc' import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' -import { Uploadx } from '@uploadx/core' import { VideoCreate, VideoState } from '../../../../shared' import { HttpStatusCode } from '../../../../shared/models' import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' @@ -41,8 +41,8 @@ import { authenticate, videosAddLegacyValidator, videosAddResumableInitValidator, - videosResumableUploadIdValidator, - videosAddResumableValidator + videosAddResumableValidator, + videosResumableUploadIdValidator } from '../../../middlewares' import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' import { VideoModel } from '../../../models/video/video' @@ -52,9 +52,6 @@ const lTags = loggerTagsFactory('api', 'video') const auditLogger = auditLoggerFactory('videos') const uploadRouter = express.Router() -const uploadx = new Uploadx({ directory: getResumableUploadPath() }) -uploadx.getUserId = (_, res: express.Response) => res.locals.oauth?.token.user.id - const reqVideoFileAdd = createReqFiles( [ 'videofile', 'thumbnailfile', 'previewfile' ], Object.assign({}, MIMETYPES.VIDEO.MIMETYPE_EXT, MIMETYPES.IMAGE.MIMETYPE_EXT), -- cgit v1.2.3