From 5126bccbc75705273b2de9a7823f032a2a147211 Mon Sep 17 00:00:00 2001 From: knotteye Date: Sat, 17 Oct 2020 02:17:10 -0500 Subject: [PATCH] Add configurability to cluster option --- install/config.example.yml | 3 +++ src/index.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/install/config.example.yml b/install/config.example.yml index be1a5a0..8925c03 100644 --- a/install/config.example.yml +++ b/install/config.example.yml @@ -9,6 +9,9 @@ media: ffmpeg: '' rtmp: + # enable cluster mode this will pretty much entirely + # break the ability to play rtmp for clients + cluster: false port: 1935 http: diff --git a/src/index.ts b/src/index.ts index 2573948..d2c3f15 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,12 +4,13 @@ import {init as initHTTP} from "./http"; import {init as clean} from "./cleanup"; import {init as initChat} from "./chat"; import { config } from "./config"; +import { execFile } from "child_process"; async function run() { await initDB(); await clean(); await initHTTP(); - await initRTMP(); + config['rtmp']['cluster'] ? execFile(process.cwd()+'/node_modules/.bin/ts-node' [process.cwd()+'src/cluster.ts']) : await initRTMP(); await initChat(); console.log(`Satyr v${config['satyr']['version']} ready`); }