diff options
author | Chocobozzz <me@florianbigard.com> | 2022-02-09 11:40:47 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-02-09 11:54:18 +0100 |
commit | 7630e1c893f9848dce9d94135ce9b9a21ab80788 (patch) | |
tree | c5d171141b471d545c5da3b7ad27c4312dfd9b8d /server/lib/job-queue | |
parent | 474542d7ac60f7860daf9ea34d1c31968f43ab29 (diff) | |
download | PeerTube-7630e1c893f9848dce9d94135ce9b9a21ab80788.tar.gz PeerTube-7630e1c893f9848dce9d94135ce9b9a21ab80788.tar.zst PeerTube-7630e1c893f9848dce9d94135ce9b9a21ab80788.zip |
Fix import timeout inconsistency
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r-- | server/lib/job-queue/handlers/video-import.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index 1630ecabd..b6e05d8f5 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts | |||
@@ -29,7 +29,7 @@ import { ffprobePromise, getDurationFromVideoFile, getVideoFileFPS, getVideoFile | |||
29 | import { logger } from '../../../helpers/logger' | 29 | import { logger } from '../../../helpers/logger' |
30 | import { getSecureTorrentName } from '../../../helpers/utils' | 30 | import { getSecureTorrentName } from '../../../helpers/utils' |
31 | import { createTorrentAndSetInfoHash, downloadWebTorrentVideo } from '../../../helpers/webtorrent' | 31 | import { createTorrentAndSetInfoHash, downloadWebTorrentVideo } from '../../../helpers/webtorrent' |
32 | import { VIDEO_IMPORT_TIMEOUT } from '../../../initializers/constants' | 32 | import { JOB_TTL } from '../../../initializers/constants' |
33 | import { sequelizeTypescript } from '../../../initializers/database' | 33 | import { sequelizeTypescript } from '../../../initializers/database' |
34 | import { VideoModel } from '../../../models/video/video' | 34 | import { VideoModel } from '../../../models/video/video' |
35 | import { VideoFileModel } from '../../../models/video/video-file' | 35 | import { VideoFileModel } from '../../../models/video/video-file' |
@@ -72,7 +72,7 @@ async function processTorrentImport (job: Job, videoImport: MVideoImportDefault, | |||
72 | torrentName: videoImport.torrentName ? getSecureTorrentName(videoImport.torrentName) : undefined, | 72 | torrentName: videoImport.torrentName ? getSecureTorrentName(videoImport.torrentName) : undefined, |
73 | uri: videoImport.magnetUri | 73 | uri: videoImport.magnetUri |
74 | } | 74 | } |
75 | return processFile(() => downloadWebTorrentVideo(target, VIDEO_IMPORT_TIMEOUT), videoImport, options) | 75 | return processFile(() => downloadWebTorrentVideo(target, JOB_TTL['video-import']), videoImport, options) |
76 | } | 76 | } |
77 | 77 | ||
78 | async function processYoutubeDLImport (job: Job, videoImport: MVideoImportDefault, payload: VideoImportYoutubeDLPayload) { | 78 | async function processYoutubeDLImport (job: Job, videoImport: MVideoImportDefault, payload: VideoImportYoutubeDLPayload) { |
@@ -83,7 +83,7 @@ async function processYoutubeDLImport (job: Job, videoImport: MVideoImportDefaul | |||
83 | const youtubeDL = new YoutubeDLWrapper(videoImport.targetUrl, ServerConfigManager.Instance.getEnabledResolutions('vod')) | 83 | const youtubeDL = new YoutubeDLWrapper(videoImport.targetUrl, ServerConfigManager.Instance.getEnabledResolutions('vod')) |
84 | 84 | ||
85 | return processFile( | 85 | return processFile( |
86 | () => youtubeDL.downloadVideo(payload.fileExt, VIDEO_IMPORT_TIMEOUT), | 86 | () => youtubeDL.downloadVideo(payload.fileExt, JOB_TTL['video-import']), |
87 | videoImport, | 87 | videoImport, |
88 | options | 88 | options |
89 | ) | 89 | ) |