Merge branch 'release/2.1.0' into develop
[oweals/peertube.git] / server / initializers / checker-before-init.ts
index d32ff9b8161615c6795d4b4c5807941742395cfe..a75f2cec2a82e43666d818f53cba3557db5d3b3c 100644 (file)
@@ -35,8 +35,8 @@ function checkMissedConfig () {
   ]
   const requiredAlternatives = [
     [ // set
-      ['redis.hostname', 'redis.port'], // alternative
-      ['redis.socket']
+      [ 'redis.hostname', 'redis.port' ], // alternative
+      [ 'redis.socket' ]
     ]
   ]
   const miss: string[] = []
@@ -69,13 +69,13 @@ function checkMissedConfig () {
 // Check the available codecs
 // We get CONFIG by param to not import it in this file (import orders)
 async function checkFFmpeg (CONFIG: { TRANSCODING: { ENABLED: boolean } }) {
+  if (CONFIG.TRANSCODING.ENABLED === false) return undefined
+
   const Ffmpeg = require('fluent-ffmpeg')
   const getAvailableCodecsPromise = promisify0(Ffmpeg.getAvailableCodecs)
   const codecs = await getAvailableCodecsPromise()
   const canEncode = [ 'libx264' ]
 
-  if (CONFIG.TRANSCODING.ENABLED === false) return undefined
-
   for (const codec of canEncode) {
     if (codecs[codec] === undefined) {
       throw new Error('Unknown codec ' + codec + ' in FFmpeg.')