Add Cron to delete old, read articles. Update Deno.

This commit is contained in:
Bruno Bernardino
2024-10-14 15:13:55 +01:00
parent 8062df1bb5
commit fbcaab53d0
5 changed files with 50 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
import { Cron } from 'https://deno.land/x/croner@8.0.1/dist/croner.js';
import { Cron } from 'https://deno.land/x/croner@8.1.2/dist/croner.js';
import { isAppEnabled } from '/lib/config.ts';
import { cleanupSessions } from './cleanup.ts';
import { fetchNewArticles } from './news.ts';
import { cleanupSessions } from './sessions.ts';
import { cleanupOldArticles, fetchNewArticles } from './news.ts';
export function startCrons() {
new Cron(
@@ -14,6 +14,10 @@ export function startCrons() {
},
async () => {
await cleanupSessions();
if (isAppEnabled('news')) {
await cleanupOldArticles();
}
},
);