mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Add timeout on youtube dl to cleaup files
This commit is contained in:
parent
2a27c451f7
commit
cf9166cf2f
5 changed files with 30 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
|||
import { AbstractScheduler } from './abstract-scheduler'
|
||||
import { CONFIG, JOB_TTL, REDUNDANCY } from '../../initializers'
|
||||
import { CONFIG, REDUNDANCY, VIDEO_IMPORT_TIMEOUT } from '../../initializers'
|
||||
import { logger } from '../../helpers/logger'
|
||||
import { VideosRedundancy } from '../../../shared/models/redundancy'
|
||||
import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy'
|
||||
|
@ -9,7 +9,6 @@ import { join } from 'path'
|
|||
import { rename } from 'fs-extra'
|
||||
import { getServerActor } from '../../helpers/utils'
|
||||
import { sendCreateCacheFile, sendUpdateCacheFile } from '../activitypub/send'
|
||||
import { VideoModel } from '../../models/video/video'
|
||||
import { getVideoCacheFileActivityPubUrl } from '../activitypub/url'
|
||||
import { removeVideoRedundancy } from '../redundancy'
|
||||
import { getOrCreateVideoAndAccountAndChannel } from '../activitypub'
|
||||
|
@ -142,7 +141,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler {
|
|||
const { baseUrlHttp, baseUrlWs } = video.getBaseUrls()
|
||||
const magnetUri = video.generateMagnetUri(file, baseUrlHttp, baseUrlWs)
|
||||
|
||||
const tmpPath = await downloadWebTorrentVideo({ magnetUri }, JOB_TTL['video-import'])
|
||||
const tmpPath = await downloadWebTorrentVideo({ magnetUri }, VIDEO_IMPORT_TIMEOUT)
|
||||
|
||||
const destPath = join(CONFIG.STORAGE.VIDEOS_DIR, video.getVideoFilename(file))
|
||||
await rename(tmpPath, destPath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue