aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-09 11:40:47 +0100
committerChocobozzz <me@florianbigard.com>2022-02-09 11:54:18 +0100
commit7630e1c893f9848dce9d94135ce9b9a21ab80788 (patch)
treec5d171141b471d545c5da3b7ad27c4312dfd9b8d /server/lib
parent474542d7ac60f7860daf9ea34d1c31968f43ab29 (diff)
downloadPeerTube-7630e1c893f9848dce9d94135ce9b9a21ab80788.tar.gz
PeerTube-7630e1c893f9848dce9d94135ce9b9a21ab80788.tar.zst
PeerTube-7630e1c893f9848dce9d94135ce9b9a21ab80788.zip
Fix import timeout inconsistency
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/job-queue/handlers/video-import.ts6
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
29import { logger } from '../../../helpers/logger' 29import { logger } from '../../../helpers/logger'
30import { getSecureTorrentName } from '../../../helpers/utils' 30import { getSecureTorrentName } from '../../../helpers/utils'
31import { createTorrentAndSetInfoHash, downloadWebTorrentVideo } from '../../../helpers/webtorrent' 31import { createTorrentAndSetInfoHash, downloadWebTorrentVideo } from '../../../helpers/webtorrent'
32import { VIDEO_IMPORT_TIMEOUT } from '../../../initializers/constants' 32import { JOB_TTL } from '../../../initializers/constants'
33import { sequelizeTypescript } from '../../../initializers/database' 33import { sequelizeTypescript } from '../../../initializers/database'
34import { VideoModel } from '../../../models/video/video' 34import { VideoModel } from '../../../models/video/video'
35import { VideoFileModel } from '../../../models/video/video-file' 35import { 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
78async function processYoutubeDLImport (job: Job, videoImport: MVideoImportDefault, payload: VideoImportYoutubeDLPayload) { 78async 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 )