aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/checker-before-init.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-11-05 11:08:51 +0100
committerChocobozzz <me@florianbigard.com>2019-11-05 11:08:51 +0100
commit959dbbd7bf655e9a36a310838dae75b9909f0096 (patch)
treeb7801ddcb78098fc51ecc4678074d251453bbfa3 /server/initializers/checker-before-init.ts
parent5d9e4eaabe87ff1b115114b01075b9fabd2b0c5e (diff)
downloadPeerTube-959dbbd7bf655e9a36a310838dae75b9909f0096.tar.gz
PeerTube-959dbbd7bf655e9a36a310838dae75b9909f0096.tar.zst
PeerTube-959dbbd7bf655e9a36a310838dae75b9909f0096.zip
Avoid circular error in logger
Diffstat (limited to 'server/initializers/checker-before-init.ts')
-rw-r--r--server/initializers/checker-before-init.ts4
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)
71async function checkFFmpeg (CONFIG: { TRANSCODING: { ENABLED: boolean } }) { 71async 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.')