1
0
Fork 0

Add benchmark startup option for server

This commit is contained in:
Chocobozzz 2021-11-12 11:08:20 +01:00
parent 8db19c959e
commit a9cd881bf8
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -136,6 +136,7 @@ import { VideoViews } from '@server/lib/video-views'
cli cli
.option('--no-client', 'Start PeerTube without client interface') .option('--no-client', 'Start PeerTube without client interface')
.option('--no-plugins', 'Start PeerTube without plugins/themes enabled') .option('--no-plugins', 'Start PeerTube without plugins/themes enabled')
.option('--benchmark-startup', 'Automatically stop server when initialized')
.parse(process.argv) .parse(process.argv)
// ----------- App ----------- // ----------- App -----------
@ -324,6 +325,8 @@ async function startApplication () {
logger.info('Web server: %s', WEBSERVER.URL) logger.info('Web server: %s', WEBSERVER.URL)
Hooks.runAction('action:application.listening') Hooks.runAction('action:application.listening')
if (cliOptions['benchmarkStartup']) process.exit(0)
}) })
process.on('exit', () => { process.on('exit', () => {