Cache trends API results at a different interval than trends calculations

This commit is contained in:
Alex Gleason 2024-06-15 17:18:55 -05:00
parent 844ebe0323
commit a3b7acd1c1
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -11,7 +11,7 @@ import { renderStatus } from '@/views/mastodon/statuses.ts';
let trendingHashtagsCache = getTrendingHashtags();
Deno.cron('update trending hashtags cache', { minute: { every: 15 } }, async () => {
Deno.cron('update trending hashtags cache', '35 * * * *', async () => {
const trends = await getTrendingHashtags();
trendingHashtagsCache = Promise.resolve(trends);
});
@ -50,7 +50,7 @@ async function getTrendingHashtags() {
let trendingLinksCache = getTrendingLinks();
Deno.cron('update trending links cache', { minute: { every: 15 } }, async () => {
Deno.cron('update trending links cache', '50 * * * *', async () => {
const trends = await getTrendingLinks();
trendingLinksCache = Promise.resolve(trends);
});