X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server.ts;h=bfc7ee1450867bfdddf45d54f18ade4ff5f92fd8;hb=e1220d60f2806c34240d79d0f43b87c506cff8c7;hp=5e1f790645873d0f2a23ccfa0bd6c7f34eee544d;hpb=8cc6120118a9fb75b3165c9f84b2d0068d1ade72;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server.ts b/server.ts index 5e1f79064..bfc7ee145 100644 --- a/server.ts +++ b/server.ts @@ -125,7 +125,7 @@ import { PeerTubeVersionCheckScheduler } from './server/lib/schedulers/peertube- import { Hooks } from './server/lib/plugins/hooks' import { PluginManager } from './server/lib/plugins/plugin-manager' import { LiveManager } from './server/lib/live' -import { HttpStatusCode } from './shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from './shared/models/http/http-error-codes' import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' import { ServerConfigManager } from '@server/lib/server-config-manager' @@ -164,7 +164,7 @@ morgan.token('user-agent', (req: express.Request) => { }) app.use(morgan('combined', { stream: { - write: (str: string) => logger.info(str, { tags: [ 'http' ] }) + write: (str: string) => logger.info(str.trim(), { tags: [ 'http' ] }) }, skip: req => CONFIG.LOG.LOG_PING_REQUESTS === false && req.originalUrl === '/api/v1/ping' })) @@ -305,13 +305,19 @@ async function startApplication () { updateStreamingPlaylistsInfohashesIfNeeded() .catch(err => logger.error('Cannot update streaming playlist infohashes.', { err })) - if (cliOptions.plugins) await PluginManager.Instance.registerPluginsAndThemes() - LiveManager.Instance.init() if (CONFIG.LIVE.ENABLED) LiveManager.Instance.run() // Make server listening - server.listen(port, hostname, () => { + server.listen(port, hostname, async () => { + if (cliOptions.plugins) { + try { + await PluginManager.Instance.registerPluginsAndThemes() + } catch (err) { + logger.error('Cannot register plugins and themes.', { err }) + } + } + logger.info('HTTP server listening on %s:%d', hostname, port) logger.info('Web server: %s', WEBSERVER.URL)