@@ -16,12 +16,12 @@ const cronIntervalRef = remember<{
1616 current : ReturnType < typeof setIntervalAsync > | null
1717} > ( 'cronInterval' , ( ) => ( { current : null } ) )
1818
19- export function init ( ) {
19+ export async function init ( ) {
2020 console . log ( 'initializing cron interval' )
21- if ( cronIntervalRef . current ) clearIntervalAsync ( cronIntervalRef . current )
21+ if ( cronIntervalRef . current ) await clearIntervalAsync ( cronIntervalRef . current )
2222
2323 cronIntervalRef . current = setIntervalAsync (
24- ( ) => sendNextTexts ( ) . catch ( err => console . error ( err ) ) ,
24+ ( ) => sendNextTexts ( ) . catch ( ( err ) => console . error ( err ) ) ,
2525 1000 * 5 ,
2626 )
2727}
@@ -43,7 +43,7 @@ export async function sendNextTexts() {
4343 } )
4444
4545 const messagesToSend = recipients
46- . map ( recipient => {
46+ . map ( ( recipient ) => {
4747 const { scheduleCron, messages, lastRemindedAt } = recipient
4848 const lastMessage = messages [ 0 ]
4949 const interval = cronParser . parseExpression ( scheduleCron , {
@@ -64,7 +64,7 @@ export async function sendNextTexts() {
6464 prev,
6565 }
6666 } )
67- . filter ( r => r . due || r . remind )
67+ . filter ( ( r ) => r . due || r . remind )
6868
6969 if ( ! messagesToSend . length ) return
7070
0 commit comments