From cf9166cf2fb7b51a1137a259eed9338798c73500 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 1 Oct 2018 12:00:05 +0200 Subject: Add timeout on youtube dl to cleaup files --- server/lib/schedulers/videos-redundancy-scheduler.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/lib/schedulers') diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index 11ee05a53..432bade1f 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts @@ -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) -- cgit v1.2.3