From 59b95931918995444296538af91ef4ba462d7069 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 26 Dec 2023 16:38:21 -0600 Subject: [PATCH] Stop automatically cleaning up events --- src/cron.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/cron.ts b/src/cron.ts index b29ab19..6015271 100644 --- a/src/cron.ts +++ b/src/cron.ts @@ -1,22 +1,9 @@ -import * as eventsDB from '@/db/events.ts'; import { deleteUnattachedMediaByUrl, getUnattachedMedia } from '@/db/unattached-media.ts'; import { cron } from '@/deps.ts'; import { Time } from '@/utils/time.ts'; import { configUploader as uploader } from '@/uploaders/config.ts'; import { cidFromUrl } from '@/utils/ipfs.ts'; -/** Clean up old remote events. */ -async function cleanupEvents() { - console.log('Cleaning up old remote events...'); - - const [result] = await eventsDB.deleteFilters([{ - until: Math.floor((Date.now() - Time.days(7)) / 1000), - local: false, - }]); - - console.log(`Cleaned up ${result?.numDeletedRows ?? 0} old remote events.`); -} - /** Delete files that aren't attached to any events. */ async function cleanupMedia() { console.log('Deleting orphaned media files...'); @@ -38,8 +25,5 @@ async function cleanupMedia() { console.log(`Removed ${media?.length ?? 0} orphaned media files.`); } -await cleanupEvents(); await cleanupMedia(); - -cron.every15Minute(cleanupEvents); cron.every15Minute(cleanupMedia);