X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server.ts;h=f4f448e6b4732304b7c0f642067d3e8198f10171;hb=e5d91a9b9cc27b8de55dcf299c8569c89e23debb;hp=6a7dad0cdf00b6e0ddbd191890ea5c9d2a056b2c;hpb=51353d9a035fb6b81f903a8b5f391292841649fd;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server.ts b/server.ts index 6a7dad0cd..f4f448e6b 100644 --- a/server.ts +++ b/server.ts @@ -41,7 +41,12 @@ checkFFmpeg(CONFIG) process.exit(-1) }) -checkNodeVersion() +try { + checkNodeVersion() +} catch (err) { + logger.error('Error in NodeJS check.', { err }) + process.exit(-1) +} import { checkConfig, checkActivityPubUrls, checkFFmpegVersion } from './server/initializers/checker-after-init' @@ -136,6 +141,7 @@ import { VideoViews } from '@server/lib/video-views' cli .option('--no-client', 'Start PeerTube without client interface') .option('--no-plugins', 'Start PeerTube without plugins/themes enabled') + .option('--benchmark-startup', 'Automatically stop server when initialized') .parse(process.argv) // ----------- App ----------- @@ -324,6 +330,8 @@ async function startApplication () { logger.info('Web server: %s', WEBSERVER.URL) Hooks.runAction('action:application.listening') + + if (cliOptions['benchmarkStartup']) process.exit(0) }) process.on('exit', () => {