mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
Update cron-jobs.js
This commit is contained in:
@@ -3,6 +3,8 @@ const {
|
|||||||
JAMBONES_FREESWITCH,
|
JAMBONES_FREESWITCH,
|
||||||
NODE_ENV,
|
NODE_ENV,
|
||||||
JAMBONES_FREESWITCH_MAX_CALL_DURATION_MINS,
|
JAMBONES_FREESWITCH_MAX_CALL_DURATION_MINS,
|
||||||
|
TMP_FOLDER,
|
||||||
|
JAMBONZ_CLEANUP_INTERVAL_MINS
|
||||||
} = require('../config');
|
} = require('../config');
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const fsInventory = JAMBONES_FREESWITCH
|
const fsInventory = JAMBONES_FREESWITCH
|
||||||
@@ -47,9 +49,9 @@ const clearChannels = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const clearFiles = () => {
|
const clearFiles = () => {
|
||||||
//const {logger} = require('../..');
|
// Remove temp audiofiles that were not auto deleted older 300 min (or CLEANUP_INTERVAL if set) from TMP_FOLDER
|
||||||
/*const out = */ execSync('find /tmp -name "*.mp3" -mtime +2 -exec rm {} \\;');
|
let maxAge = JAMBONZ_CLEANUP_INTERVAL_MINS || 300
|
||||||
//logger.debug({out}, 'clearFiles: command output');
|
execSync(`/usr/local/bin/cleanup-temp-audiofiles.sh ${maxAge} ${TMP_FOLDER};`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user