Make it public!

This commit is contained in:
Bruno Bernardino
2024-03-16 08:40:24 +00:00
commit a5cafdddca
114 changed files with 9569 additions and 0 deletions

32
crons/index.ts Normal file
View File

@@ -0,0 +1,32 @@
import { Cron } from 'https://deno.land/x/croner@7.0.1/dist/croner.js';
import { cleanupSessions } from './cleanup.ts';
import { fetchNewArticles } from './news.ts';
export function startCrons() {
new Cron(
// At 03:06 every day.
'6 3 * * *',
{
name: 'cleanup',
protect: true,
},
async () => {
await cleanupSessions();
},
);
new Cron(
// Every 30 minutes.
'*/30 * * * *',
{
name: 'news',
protect: true,
},
async () => {
await fetchNewArticles();
},
);
console.log('Crons starting...');
}