Files
overleaf-cep/services/web/scripts/process_notifications.mjs
T
Kristina 28ad3b03b7 [web] add email notifications dry run split test (#34653)
GitOrigin-RevId: 62f73ce3850b994bf2a4a054edd6fa62134213a9
2026-06-26 08:08:18 +00:00

33 lines
753 B
JavaScript

/* eslint-disable @overleaf/require-script-runner */
import logger from '@overleaf/logger'
import { processNotifications } from '../modules/notifications/app/src/ProcessNotifications.mjs'
async function main() {
logger.info({}, 'Processing notifications...')
const {
notificationsFound,
notificationsReady,
emailsSent,
dryRunProcessed,
dryRunWouldHaveSent,
} = await processNotifications()
logger.info(
{
notificationsFound,
notificationsReady,
emailsSent,
dryRunProcessed,
dryRunWouldHaveSent,
},
'Notifications processed successfully.'
)
}
try {
await main()
process.exit(0)
} catch (error) {
logger.error({ error }, 'error processing notifications')
process.exit(1)
}