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_OTEL_SERVICE_NAME,
|
||||||
JAMBONES_LOGLEVEL,
|
JAMBONES_LOGLEVEL,
|
||||||
JAMBONES_CLUSTER_ID,
|
JAMBONES_CLUSTER_ID,
|
||||||
JAMBONZ_CLEANUP_INTERVAL_MINS,
|
|
||||||
getCleanupIntervalMins,
|
|
||||||
K8S,
|
K8S,
|
||||||
NODE_ENV,
|
NODE_ENV,
|
||||||
checkEnvs,
|
checkEnvs,
|
||||||
@@ -204,17 +202,20 @@ async function handle(signal) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (JAMBONZ_CLEANUP_INTERVAL_MINS) {
|
// Disabled in favour of OS Level Cron Job, TODO Remove in later release
|
||||||
const {clearFiles} = require('./lib/utils/cron-jobs');
|
//
|
||||||
|
//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};
|
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;
|
const JAMBONES_SUBNET = process.env.JAMBONES_SUBNET;
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
const JAMBONZ_CLEANUP_INTERVAL_MINS = process.env.JAMBONZ_CLEANUP_INTERVAL_MINS;
|
//const JAMBONZ_CLEANUP_INTERVAL_MINS = process.env.JAMBONZ_CLEANUP_INTERVAL_MINS;
|
||||||
const getCleanupIntervalMins = () => {
|
//const getCleanupIntervalMins = () => {
|
||||||
const interval = parseInt(JAMBONZ_CLEANUP_INTERVAL_MINS, 10) || 60;
|
// const interval = parseInt(JAMBONZ_CLEANUP_INTERVAL_MINS, 10) || 60;
|
||||||
return 1000 * 60 * interval;
|
// return 1000 * 60 * interval;
|
||||||
};
|
//};
|
||||||
|
|
||||||
/* speech vendors */
|
/* speech vendors */
|
||||||
const AWS_REGION = process.env.AWS_REGION;
|
const AWS_REGION = process.env.AWS_REGION;
|
||||||
@@ -184,8 +184,6 @@ module.exports = {
|
|||||||
K8S_SBC_SIP_SERVICE_NAME,
|
K8S_SBC_SIP_SERVICE_NAME,
|
||||||
JAMBONES_SUBNET,
|
JAMBONES_SUBNET,
|
||||||
NODE_ENV,
|
NODE_ENV,
|
||||||
JAMBONZ_CLEANUP_INTERVAL_MINS,
|
|
||||||
getCleanupIntervalMins,
|
|
||||||
checkEnvs,
|
checkEnvs,
|
||||||
|
|
||||||
AWS_REGION,
|
AWS_REGION,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const {execSync} = require('child_process');
|
|||||||
const {
|
const {
|
||||||
JAMBONES_FREESWITCH,
|
JAMBONES_FREESWITCH,
|
||||||
NODE_ENV,
|
NODE_ENV,
|
||||||
JAMBONES_FREESWITCH_MAX_CALL_DURATION_MINS,
|
JAMBONES_FREESWITCH_MAX_CALL_DURATION_MINS
|
||||||
} = require('../config');
|
} = require('../config');
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const fsInventory = JAMBONES_FREESWITCH
|
const fsInventory = JAMBONES_FREESWITCH
|
||||||
@@ -46,12 +46,12 @@ const clearChannels = () => {
|
|||||||
return calls.length;
|
return calls.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
const clearFiles = () => {
|
// Disabled in favour of OS Level Cron Job, TODO Remove in later release
|
||||||
//const {logger} = require('../..');
|
//const clearFiles = () => {
|
||||||
/*const out = */ execSync('find /tmp -name "*.mp3" -mtime +2 -exec rm {} \\;');
|
// //const {logger} = require('../..');
|
||||||
//logger.debug({out}, 'clearFiles: command output');
|
// /*const out = */ execSync('find /tmp -name "*.mp3" -mtime +2 -exec rm {} \\;');
|
||||||
};
|
// //logger.debug({out}, 'clearFiles: command output');
|
||||||
|
//}
|
||||||
|
|
||||||
|
module.exports = {clearChannels };
|
||||||
module.exports = {clearChannels, clearFiles};
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user