clean up scanForOrphanedVideos execution for childNode
parent
9d1f7e0991
commit
02b8546940
|
|
@ -15,6 +15,13 @@ const {
|
|||
} = require('worker_threads');
|
||||
const { copyObject, createQueue, queryStringToObject, createQueryStringFromObject } = require('./common.js')
|
||||
module.exports = function(s,config,lang){
|
||||
const isMasterNode = (
|
||||
(
|
||||
config.childNodes.enabled === true &&
|
||||
config.childNodes.mode === 'master'
|
||||
) ||
|
||||
config.childNodes.enabled === false
|
||||
);
|
||||
const {
|
||||
probeMonitor,
|
||||
getStreamInfoFromProbe,
|
||||
|
|
@ -1589,13 +1596,7 @@ module.exports = function(s,config,lang){
|
|||
status: wantedStatus,
|
||||
code: wantedStatusCode,
|
||||
})
|
||||
if(
|
||||
(
|
||||
config.childNodes.enabled === true &&
|
||||
config.childNodes.mode === 'master'
|
||||
) ||
|
||||
config.childNodes.enabled === false
|
||||
){
|
||||
if(isMasterNode){
|
||||
setTimeout(() => {
|
||||
scanForOrphanedVideos({
|
||||
ke: e.ke,
|
||||
|
|
@ -1604,7 +1605,7 @@ module.exports = function(s,config,lang){
|
|||
forceCheck: true,
|
||||
checkMax: 2
|
||||
})
|
||||
},2000)
|
||||
},2000)
|
||||
}
|
||||
clearTimeout(s.group[e.ke].activeMonitors[e.id].onMonitorStartTimer)
|
||||
s.onMonitorStopExtensions.forEach(function(extender){
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
const fs = require('fs')
|
||||
const { spawn } = require('child_process')
|
||||
module.exports = (s,config,lang) => {
|
||||
const isMasterNode = (
|
||||
(
|
||||
config.childNodes.enabled === true &&
|
||||
config.childNodes.mode === 'master'
|
||||
) ||
|
||||
config.childNodes.enabled === false
|
||||
);
|
||||
// orphanedVideoCheck : new function
|
||||
const checkIfVideoIsOrphaned = (monitor,videosDirectory,filename) => {
|
||||
const response = {ok: true}
|
||||
|
|
@ -47,7 +40,7 @@ module.exports = (s,config,lang) => {
|
|||
})
|
||||
})
|
||||
}
|
||||
let scanForOrphanedVideos = (monitor,options) => {
|
||||
const scanForOrphanedVideos = (monitor,options) => {
|
||||
// const options = {
|
||||
// checkMax: 2
|
||||
// }
|
||||
|
|
@ -122,11 +115,6 @@ module.exports = (s,config,lang) => {
|
|||
}
|
||||
})
|
||||
}
|
||||
if(!isMasterNode){
|
||||
scanForOrphanedVideos = async () => {
|
||||
return {ok: true, orphanedFilesCount: 0}
|
||||
}
|
||||
}
|
||||
// orphanedVideoCheck : old function
|
||||
const orphanedVideoCheck = (monitor,checkMax,callback,forceCheck) => {
|
||||
var finish = function(orphanedFilesCount){
|
||||
|
|
|
|||
Loading…
Reference in New Issue