X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fserver%2Fserver.ts;h=5bdcbac5243093449b0cd16019344be66443927d;hb=2e980ed30dc37061b467ebbb68094f830bffdb5d;hp=b33bb9d1e5f28bcc94142b2b97bbab22c1f6cae5;hpb=c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/server/server.ts b/shared/extra-utils/server/server.ts index b33bb9d1e..5bdcbac52 100644 --- a/shared/extra-utils/server/server.ts +++ b/shared/extra-utils/server/server.ts @@ -41,7 +41,8 @@ import { StatsCommand } from './stats-command' export type RunServerOptions = { hideLogs?: boolean - execArgv?: string[] + nodeArgs?: string[] + peertubeArgs?: string[] } export class PeerTubeServer { @@ -176,13 +177,13 @@ export class PeerTubeServer { this.port = parseInt(parsed.port) } - async flushAndRun (configOverride?: Object, args = [], options: RunServerOptions = {}) { + async flushAndRun (configOverride?: Object, options: RunServerOptions = {}) { await ServersCommand.flushTests(this.internalServerNumber) - return this.run(configOverride, args, options) + return this.run(configOverride, options) } - async run (configOverrideArg?: any, args = [], options: RunServerOptions = {}) { + async run (configOverrideArg?: any, options: RunServerOptions = {}) { // These actions are async so we need to be sure that they have both been done const serverRunString = { 'HTTP server listening': false @@ -215,13 +216,13 @@ export class PeerTubeServer { silent: true, env, detached: true, - execArgv: options.execArgv || [] + execArgv: options.nodeArgs || [] } return new Promise(res => { const self = this - this.app = fork(join(root(), 'dist', 'server.js'), args, forkOptions) + this.app = fork(join(root(), 'dist', 'server.js'), options.peertubeArgs || [], forkOptions) this.app.stdout.on('data', function onStdout (data) { let dontContinue = false