mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
* [snyk] fix vulnerabilities * move all process.env in one config * update log level in config * check envs * fix imports in tests for microsoft, soniox, deepgram * fix import in gather-test * fix missing imports --------- Co-authored-by: Markus Frindt <m.frindt@cognigy.com>
30 lines
681 B
JavaScript
Executable File
30 lines
681 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
const bent = require('bent');
|
|
const getJSON = bent('json');
|
|
const {PORT} = require('../lib/config')
|
|
|
|
const sleep = (ms) => {
|
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
};
|
|
|
|
(async function() {
|
|
|
|
try {
|
|
do {
|
|
const obj = await getJSON(`http://127.0.0.1:${PORT}/`);
|
|
const {calls} = obj;
|
|
if (calls === 0) {
|
|
console.log('no calls on the system, we can exit');
|
|
process.exit(0);
|
|
}
|
|
else {
|
|
console.log(`waiting for ${calls} to exit..`);
|
|
}
|
|
await sleep(10000);
|
|
} while (1);
|
|
} catch (err) {
|
|
console.error(err, 'Error querying health endpoint');
|
|
process.exit(-1);
|
|
}
|
|
})();
|