15 lines
524 B
JavaScript
15 lines
524 B
JavaScript
import { dispatchPendingNotifications } from '../src/services/notification-dispatcher.js';
|
|
import { closePool } from '../src/services/db.js';
|
|
|
|
try {
|
|
const summary = await dispatchPendingNotifications();
|
|
// eslint-disable-next-line no-console
|
|
console.log(JSON.stringify({ ok: true, summary }, null, 2));
|
|
} catch (error) {
|
|
// eslint-disable-next-line no-console
|
|
console.error(JSON.stringify({ ok: false, error: error?.message || String(error) }, null, 2));
|
|
process.exitCode = 1;
|
|
} finally {
|
|
await closePool();
|
|
}
|