disable node.js cleanup

This commit is contained in:
Sam Machin authored and Dave Horton committed 2025-07-29 10:05:45 -04:00
1 parent 55939752e2
commit 41106ddfc1
2 files changed
+22 -21

No files matched your search

+8 -10
View File
@@ -2,9 +2,7 @@ const {execSync} = require('child_process');
const {
JAMBONES_FREESWITCH,
NODE_ENV,
JAMBONES_FREESWITCH_MAX_CALL_DURATION_MINS,
TMP_FOLDER,
JAMBONZ_CLEANUP_INTERVAL_MINS
JAMBONES_FREESWITCH_MAX_CALL_DURATION_MINS
} = require('../config');
const now = Date.now();
const fsInventory = JAMBONES_FREESWITCH
@@ -48,12 +46,12 @@ const clearChannels = () => {
return calls.length;
};
const clearFiles = () => {
// Remove temp audiofiles that were not auto deleted older 300 min (or CLEANUP_INTERVAL if set) from TMP_FOLDER
const maxAge = JAMBONZ_CLEANUP_INTERVAL_MINS || 300;
execSync(`/usr/local/bin/cleanup-temp-audiofiles.sh ${maxAge} ${TMP_FOLDER};`);
};
// Disabled in favour of OS Level Cron Job, TODO Remove in later release
//const clearFiles = () => {
// //const {logger} = require('../..');
// /*const out = */ execSync('find /tmp -name "*.mp3" -mtime +2 -exec rm {} \\;');
// //logger.debug({out}, 'clearFiles: command output');
//}
module.exports = {clearChannels, clearFiles};
module.exports = {clearChannels };