add config.monitorDetectorDaemonPath to change cameraThread/detector.js

change-spawn-to-worker-for-monitor-daemon
Moe 2021-08-28 11:21:44 -07:00
parent cdfe5b4643
commit 99a3b1aeed
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ const isWindows = (process.platform === 'win32' || process.platform === 'win64')
process.send = process.send || function () {};
var jsonData = JSON.parse(fs.readFileSync(process.argv[3],'utf8'))
const config = jsonData.globalInfo.config
const ffmpegAbsolutePath = process.argv[2].trim()
const ffmpegCommandString = jsonData.cmd
const rawMonitorConfig = jsonData.rawMonitorConfig
@ -110,7 +111,7 @@ writeToStderr('Thread Opening')
if(rawMonitorConfig.details.detector === '1' && rawMonitorConfig.details.detector_pam === '1'){
try{
const attachPamDetector = require(__dirname + '/detector.js')(jsonData,stdioWriters[3])
const attachPamDetector = require(config.monitorDetectorDaemonPath ? config.monitorDetectorDaemonPath : __dirname + '/detector.js')(jsonData,stdioWriters[3])
attachPamDetector(cameraProcess,(err)=>{
writeToStderr(err)
})