]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add ability to set a custom video import timeout
authorChocobozzz <me@florianbigard.com>
Tue, 24 May 2022 12:55:07 +0000 (14:55 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 24 May 2022 12:55:07 +0000 (14:55 +0200)
config/default.yaml
config/production.yaml.example
server/initializers/checker-before-init.ts
server/initializers/config.ts
server/initializers/constants.ts
server/lib/schedulers/geo-ip-update-scheduler.ts

index 689f81343d948a1f57f74fe3dcebd6e9dd324f24..c3e42350b7b6d2f9d169dc00c6c7e32d8e5e5f7e 100644 (file)
@@ -470,6 +470,9 @@ import:
     # Amount of import jobs to execute in parallel
     concurrency: 1
 
+    # Set a custom video import timeout to not block import queue
+    timeout: '2 hours'
+
     # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html
     http:
       # We recommend to use a HTTP proxy if you enable HTTP import to prevent private URL access from this server
index 6db43fccf7139f9b24147f8757082dc2d2187621..4351a4b87a80acb32cb32e710777e6579d10d096 100644 (file)
@@ -478,6 +478,9 @@ import:
     # Amount of import jobs to execute in parallel
     concurrency: 1
 
+    # Set a custom video import timeout to not block import queue
+    timeout: '2 hours'
+
     # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html
     http:
       # We recommend to use a HTTP proxy if you enable HTTP import to prevent private URL access from this server
index 79430374399ebda9ad0bc11d6dc077f0464be1a7..26657924609f003792dbf59671c84eb70c9a7270 100644 (file)
@@ -31,8 +31,8 @@ function checkMissedConfig () {
     'transcoding.resolutions.0p', 'transcoding.resolutions.144p', 'transcoding.resolutions.240p', 'transcoding.resolutions.360p',
     'transcoding.resolutions.480p', 'transcoding.resolutions.720p', 'transcoding.resolutions.1080p', 'transcoding.resolutions.1440p',
     'transcoding.resolutions.2160p', 'video_studio.enabled',
-    'import.videos.http.enabled', 'import.videos.torrent.enabled', 'import.videos.concurrency', 'auto_blacklist.videos.of_users.enabled',
-    'trending.videos.interval_days',
+    'import.videos.http.enabled', 'import.videos.torrent.enabled', 'import.videos.concurrency', 'import.videos.timeout',
+    'auto_blacklist.videos.of_users.enabled', 'trending.videos.interval_days',
     'client.videos.miniature.display_author_avatar',
     'client.videos.miniature.prefer_author_display_name', 'client.menu.login.redirect_on_single_external_auth',
     'defaults.publish.download_enabled', 'defaults.publish.comments_enabled', 'defaults.publish.privacy', 'defaults.publish.licence',
index 59a65d6a56cd6ef33583e2cd7684670b5090cb0c..2f59e3e3e2ef8b7dec3cea039478a4985cac41ad 100644 (file)
@@ -349,6 +349,7 @@ const CONFIG = {
   IMPORT: {
     VIDEOS: {
       get CONCURRENCY () { return config.get<number>('import.videos.concurrency') },
+      get TIMEOUT () { return parseDurationToMs(config.get<string>('import.videos.timeout')) },
 
       HTTP: {
         get ENABLED () { return config.get<boolean>('import.videos.http.enabled') },
index 909fffdb632baf4400d37aaa9c46c76de3038880..02c1ef251a193bce4530f1cb26ad51a1242b7fbf 100644 (file)
@@ -183,7 +183,7 @@ const JOB_TTL: { [id in JobType]: number } = {
   'video-file-import': 1000 * 3600, // 1 hour
   'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long
   'video-studio-edition': 1000 * 3600 * 10, // 10 hours
-  'video-import': 1000 * 3600 * 2, // 2 hours
+  'video-import': CONFIG.IMPORT.VIDEOS.TIMEOUT,
   'email': 60000 * 10, // 10 minutes
   'actor-keys': 60000 * 20, // 20 minutes
   'videos-views-stats': undefined, // Unlimited
index 9dda6d76cb3af424dc65041dae3a25eaf52fd6f2..b06f5a9b5593abd2bfca604df866174d82c421fc 100644 (file)
@@ -6,7 +6,7 @@ export class GeoIPUpdateScheduler extends AbstractScheduler {
 
   private static instance: AbstractScheduler
 
-  protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.YOUTUBE_DL_UPDATE
+  protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.GEO_IP_UPDATE
 
   private constructor () {
     super()