disable scanForOrphanedVideos on child node completely

montage-api
Moe 2021-11-29 21:14:57 -08:00
parent 1fc0c1d03e
commit 9d1f7e0991
1 changed files with 13 additions and 1 deletions

View File

@ -1,6 +1,13 @@
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}
@ -40,7 +47,7 @@ module.exports = (s,config,lang) => {
})
})
}
const scanForOrphanedVideos = (monitor,options) => {
let scanForOrphanedVideos = (monitor,options) => {
// const options = {
// checkMax: 2
// }
@ -115,6 +122,11 @@ 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){