Compare commits

..

1 Commits

Author SHA1 Message Date
8887031284 Use winston for logging 2021-03-14 21:26:40 -06:00
2 changed files with 4 additions and 4 deletions

View File

@ -114,13 +114,13 @@ async function main() {
const rcsdk = await initRingCentralSDK(); const rcsdk = await initRingCentralSDK();
const db = await initDB(); const db = await initDB();
logger.info("Starting");
const intervals = ticketize(sonar, rcsdk, db, getTicketizeConfig()); const intervals = ticketize(sonar, rcsdk, db, getTicketizeConfig());
logger.info("Started");
["SIGINT", "SIGTERM", "SIGQUIT"].forEach((sig) => { ["SIGINT", "SIGTERM", "SIGQUIT"].forEach((sig) => {
process.on(sig, async () => { process.on(sig, async () => {
logger.info(`Caught ${sig}, shutting down...`); logger.info(`\nCaught ${sig}, shutting down...`);
const results = await Promise.allSettled( const results = await Promise.allSettled(
intervals.map((interval) => interval.clear()) intervals.map((interval) => interval.clear())
); );

View File

@ -340,7 +340,7 @@ export function ticketize(
* @param firstRun whether this is the first run * @param firstRun whether this is the first run
*/ */
async function fetchAndStoreNewVoicemails(firstRun = false) { async function fetchAndStoreNewVoicemails(firstRun = false) {
logger.verbose("Checking for new voicemails"); logger.info("Checking for new voicemails");
const extensions = await getValidRCExtensions(); const extensions = await getValidRCExtensions();
return Promise.all( return Promise.all(
extensions.map((extension) => extensions.map((extension) =>