packages/server-commands/src/server/server.ts
File server.ts
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { randomInt } from '@peertube/peertube-core-utils'
import { Video, VideoChannel, VideoChannelSync, VideoCreateResult, VideoDetails } from '@peertube/peertube-models'
import { parallelTests, root } from '@peertube/peertube-node-utils'
import { ChildProcess, fork } from 'child_process'
import { copy } from 'fs-extra/esm'
Function run
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
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
}
Function assignCommands
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private assignCommands () {
this.bulk = new BulkCommand(this)
this.cli = new CLICommand(this)
this.customPage = new CustomPagesCommand(this)
this.feed = new FeedCommand(this)
Function buildConfigOverride
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildConfigOverride (options: RunServerOptions) {
const base = options.autoEnableImportProxy !== false && process.env.YOUTUBE_DL_PROXY
? { import: { videos: { http: { proxies: [ process.env.YOUTUBE_DL_PROXY ] } } } }
: {}
Function onStdout
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.app.stdout.on('data', function onStdout (data) {
let dontContinue = false
const log: string = data.toString()
aggregatedLogs += log