From f2ccb5254e8db3030a08c9cba6a4a4098931f6fc Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 5 Sep 2023 21:52:16 -0500 Subject: [PATCH] cron: run cleanupEvents on startup --- src/cron.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cron.ts b/src/cron.ts index 0085c59..a08fdf6 100644 --- a/src/cron.ts +++ b/src/cron.ts @@ -11,7 +11,9 @@ async function cleanupEvents() { local: false, }]); - console.log(`Deleted ${result?.numDeletedRows ?? 0} events.`); + console.log(`Cleaned up ${result?.numDeletedRows ?? 0} old remote events.`); } +await cleanupEvents(); + cron.every15Minute(cleanupEvents);