pass dataPort to detector engine

obj-track-as-separate-option
Moe 2023-12-13 16:59:52 -08:00
parent 7c06ba823f
commit e08931e441
2 changed files with 2 additions and 1 deletions

View File

@ -137,7 +137,7 @@ if(rawMonitorConfig.details.detector === '1' && rawMonitorConfig.details.detecto
try{ try{
const attachPamDetector = require(config.monitorDetectorDaemonPath ? config.monitorDetectorDaemonPath : __dirname + '/detector.js')(jsonData,(detectorObject) => { const attachPamDetector = require(config.monitorDetectorDaemonPath ? config.monitorDetectorDaemonPath : __dirname + '/detector.js')(jsonData,(detectorObject) => {
dataPort.send(JSON.stringify(detectorObject)) dataPort.send(JSON.stringify(detectorObject))
}) },dataPort)
attachPamDetector(cameraProcess) attachPamDetector(cameraProcess)
}catch(err){ }catch(err){
writeToStderr(err.stack) writeToStderr(err.stack)

View File

@ -5,6 +5,7 @@ module.exports = function(s,config,lang,app,io){
} = require('./events/utils.js')(s,config,lang) } = require('./events/utils.js')(s,config,lang)
s.dataPortTokens = {} s.dataPortTokens = {}
const theWebSocket = createWebSocketServer() const theWebSocket = createWebSocketServer()
s.dataPortServer = theWebSocket;
function setClientKillTimerIfNotAuthenticatedInTime(client){ function setClientKillTimerIfNotAuthenticatedInTime(client){
client.killTimer = setTimeout(function(){ client.killTimer = setTimeout(function(){
client.terminate() client.terminate()