Respect CONFIG_ENABLED_APPS in .env
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Cron } from 'https://deno.land/x/croner@8.0.1/dist/croner.js';
|
||||
|
||||
import { isAppEnabled } from '/lib/config.ts';
|
||||
import { cleanupSessions } from './cleanup.ts';
|
||||
import { fetchNewArticles } from './news.ts';
|
||||
|
||||
@@ -16,17 +17,19 @@ export function startCrons() {
|
||||
},
|
||||
);
|
||||
|
||||
new Cron(
|
||||
// Every 30 minutes.
|
||||
'*/30 * * * *',
|
||||
{
|
||||
name: 'news',
|
||||
protect: true,
|
||||
},
|
||||
async () => {
|
||||
await fetchNewArticles();
|
||||
},
|
||||
);
|
||||
if (isAppEnabled('news')) {
|
||||
new Cron(
|
||||
// Every 30 minutes.
|
||||
'*/30 * * * *',
|
||||
{
|
||||
name: 'news',
|
||||
protect: true,
|
||||
},
|
||||
async () => {
|
||||
await fetchNewArticles();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
console.log('Crons starting...');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user