diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-05 11:08:51 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-05 11:08:51 +0100 |
commit | 959dbbd7bf655e9a36a310838dae75b9909f0096 (patch) | |
tree | b7801ddcb78098fc51ecc4678074d251453bbfa3 /server/initializers | |
parent | 5d9e4eaabe87ff1b115114b01075b9fabd2b0c5e (diff) | |
download | PeerTube-959dbbd7bf655e9a36a310838dae75b9909f0096.tar.gz PeerTube-959dbbd7bf655e9a36a310838dae75b9909f0096.tar.zst PeerTube-959dbbd7bf655e9a36a310838dae75b9909f0096.zip |
Avoid circular error in logger
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/checker-before-init.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts index d32ff9b81..9731a0af9 100644 --- a/server/initializers/checker-before-init.ts +++ b/server/initializers/checker-before-init.ts | |||
@@ -69,13 +69,13 @@ function checkMissedConfig () { | |||
69 | // Check the available codecs | 69 | // Check the available codecs |
70 | // We get CONFIG by param to not import it in this file (import orders) | 70 | // We get CONFIG by param to not import it in this file (import orders) |
71 | async function checkFFmpeg (CONFIG: { TRANSCODING: { ENABLED: boolean } }) { | 71 | async function checkFFmpeg (CONFIG: { TRANSCODING: { ENABLED: boolean } }) { |
72 | if (CONFIG.TRANSCODING.ENABLED === false) return undefined | ||
73 | |||
72 | const Ffmpeg = require('fluent-ffmpeg') | 74 | const Ffmpeg = require('fluent-ffmpeg') |
73 | const getAvailableCodecsPromise = promisify0(Ffmpeg.getAvailableCodecs) | 75 | const getAvailableCodecsPromise = promisify0(Ffmpeg.getAvailableCodecs) |
74 | const codecs = await getAvailableCodecsPromise() | 76 | const codecs = await getAvailableCodecsPromise() |
75 | const canEncode = [ 'libx264' ] | 77 | const canEncode = [ 'libx264' ] |
76 | 78 | ||
77 | if (CONFIG.TRANSCODING.ENABLED === false) return undefined | ||
78 | |||
79 | for (const codec of canEncode) { | 79 | for (const codec of canEncode) { |
80 | if (codecs[codec] === undefined) { | 80 | if (codecs[codec] === undefined) { |
81 | throw new Error('Unknown codec ' + codec + ' in FFmpeg.') | 81 | throw new Error('Unknown codec ' + codec + ' in FFmpeg.') |