Adjust intervals

We still fetch voicemails from RingCentral every 60 seconds, but now we
check for missing transcriptions every 15 seconds, and poll the database
for voicemails that are ready to be ticketized every second.
This commit is contained in:
Matt Low 2021-03-11 11:01:59 -07:00
parent 3452cd143a
commit 1052dfc1b1

View File

@ -418,22 +418,20 @@ export function ticketize(
return [ return [
setAsyncInterval( setAsyncInterval(
() => { () => {
const promise = fetchAndStoreNewVoicemails(firstRun); const promise = fetchAndStoreNewVoicemails(firstRun).catch(
catchHandler
);
firstRun = false; firstRun = false;
return promise.catch(catchHandler); return promise;
}, },
60 * 1000, 60 * 1000,
true // immediate true // immediate
), ),
setAsyncInterval( setAsyncInterval(
() => fetchMissingTranscriptions().catch(catchHandler), () => fetchMissingTranscriptions().catch(catchHandler),
60 * 1000, 15 * 1000,
true
),
setAsyncInterval(
() => createTickets().catch(catchHandler),
60 * 1000,
true true
), ),
setAsyncInterval(() => createTickets().catch(catchHandler), 1000, true),
]; ];
} }