mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-02-12 17:28:49 +00:00
Compare commits
5 Commits
v0.9.6-rc2
...
fix/1294
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3759d9c81 | ||
|
|
41106ddfc1 | ||
|
|
55939752e2 | ||
|
|
f03ec420bf | ||
|
|
10a2b15279 |
27
app.js
27
app.js
@@ -5,8 +5,6 @@ const {
|
||||
JAMBONES_OTEL_SERVICE_NAME,
|
||||
JAMBONES_LOGLEVEL,
|
||||
JAMBONES_CLUSTER_ID,
|
||||
JAMBONZ_CLEANUP_INTERVAL_MINS,
|
||||
getCleanupIntervalMins,
|
||||
K8S,
|
||||
NODE_ENV,
|
||||
checkEnvs,
|
||||
@@ -204,17 +202,20 @@ async function handle(signal) {
|
||||
}
|
||||
}
|
||||
|
||||
if (JAMBONZ_CLEANUP_INTERVAL_MINS) {
|
||||
const {clearFiles} = require('./lib/utils/cron-jobs');
|
||||
// Disabled in favour of OS Level Cron Job, TODO Remove in later release
|
||||
//
|
||||
//if (JAMBONZ_CLEANUP_INTERVAL_MINS) {
|
||||
// const {clearFiles} = require('./lib/utils/cron-jobs');
|
||||
|
||||
// /* cleanup orphaned files or channels every so often */
|
||||
// setInterval(async() => {
|
||||
// try {
|
||||
// await clearFiles();
|
||||
// } catch (err) {
|
||||
// logger.error({err}, 'app.js: error clearing files');
|
||||
// }
|
||||
// }, getCleanupIntervalMins());
|
||||
//}
|
||||
|
||||
/* cleanup orphaned files or channels every so often */
|
||||
setInterval(async() => {
|
||||
try {
|
||||
await clearFiles();
|
||||
} catch (err) {
|
||||
logger.error({err}, 'app.js: error clearing files');
|
||||
}
|
||||
}, getCleanupIntervalMins());
|
||||
}
|
||||
|
||||
module.exports = {srf, logger, disconnect};
|
||||
|
||||
@@ -82,11 +82,11 @@ const K8S_SBC_SIP_SERVICE_NAME = process.env.K8S_SBC_SIP_SERVICE_NAME;
|
||||
const JAMBONES_SUBNET = process.env.JAMBONES_SUBNET;
|
||||
|
||||
/* clean up */
|
||||
const JAMBONZ_CLEANUP_INTERVAL_MINS = process.env.JAMBONZ_CLEANUP_INTERVAL_MINS;
|
||||
const getCleanupIntervalMins = () => {
|
||||
const interval = parseInt(JAMBONZ_CLEANUP_INTERVAL_MINS, 10) || 60;
|
||||
return 1000 * 60 * interval;
|
||||
};
|
||||
//const JAMBONZ_CLEANUP_INTERVAL_MINS = process.env.JAMBONZ_CLEANUP_INTERVAL_MINS;
|
||||
//const getCleanupIntervalMins = () => {
|
||||
// const interval = parseInt(JAMBONZ_CLEANUP_INTERVAL_MINS, 10) || 60;
|
||||
// return 1000 * 60 * interval;
|
||||
//};
|
||||
|
||||
/* speech vendors */
|
||||
const AWS_REGION = process.env.AWS_REGION;
|
||||
@@ -184,8 +184,6 @@ module.exports = {
|
||||
K8S_SBC_SIP_SERVICE_NAME,
|
||||
JAMBONES_SUBNET,
|
||||
NODE_ENV,
|
||||
JAMBONZ_CLEANUP_INTERVAL_MINS,
|
||||
getCleanupIntervalMins,
|
||||
checkEnvs,
|
||||
|
||||
AWS_REGION,
|
||||
|
||||
@@ -2,7 +2,7 @@ const {execSync} = require('child_process');
|
||||
const {
|
||||
JAMBONES_FREESWITCH,
|
||||
NODE_ENV,
|
||||
JAMBONES_FREESWITCH_MAX_CALL_DURATION_MINS,
|
||||
JAMBONES_FREESWITCH_MAX_CALL_DURATION_MINS
|
||||
} = require('../config');
|
||||
const now = Date.now();
|
||||
const fsInventory = JAMBONES_FREESWITCH
|
||||
@@ -46,12 +46,12 @@ const clearChannels = () => {
|
||||
return calls.length;
|
||||
};
|
||||
|
||||
const clearFiles = () => {
|
||||
//const {logger} = require('../..');
|
||||
/*const out = */ execSync('find /tmp -name "*.mp3" -mtime +2 -exec rm {} \\;');
|
||||
//logger.debug({out}, 'clearFiles: command output');
|
||||
};
|
||||
// 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 };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user