sfu creation added
This commit is contained in:
@@ -3,7 +3,7 @@ const {get_webrtc_port, get_app_port, get_sfu_port} = require('../modules/port_a
|
||||
const {get_app_path} = require('../modules/titles')
|
||||
const not_found_error = require('../../lib/src/http/errors/not_found_error')
|
||||
const server_error = require('../../lib/src/http/errors/server_error')
|
||||
const {run_webrtc, run_app, kill_proc} = require('../modules/run_process')
|
||||
const {run_webrtc, run_app, run_sfu, kill_proc} = require('../modules/run_process')
|
||||
const {create_websocket_url} = require('../modules/links')
|
||||
const {port} = require('../../config')
|
||||
|
||||
@@ -47,8 +47,16 @@ const run_session = async (req, res, next) => {
|
||||
return
|
||||
}
|
||||
|
||||
let sfu_pid = await run_sfu(sfu_port)
|
||||
if (!sfu_pid) {
|
||||
kill_proc(app_pid)
|
||||
kill_proc(webrtc_pid)
|
||||
next(new server_error('can not run sfu'))
|
||||
return
|
||||
}
|
||||
|
||||
let add_runnning_session_result = await database.add_running_session(session_id, title, app_pid, webrtc_pid, app_port, webrtc_port, sfu_port)
|
||||
|
||||
let add_runnning_session_result = await database.add_running_session(session_id, title, app_pid, webrtc_pid, sfu_pid, app_port, webrtc_port, sfu_port)
|
||||
|
||||
if(!add_runnning_session_result) {
|
||||
next(new server_error('can not add session to database'))
|
||||
|
||||
Reference in New Issue
Block a user