mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
trends: catch initial queries
This commit is contained in:
parent
7949c95f77
commit
2b8009d840
1 changed files with 8 additions and 2 deletions
|
|
@ -9,7 +9,10 @@ import { generateDateRange, Time } from '@/utils/time.ts';
|
|||
import { unfurlCardCached } from '@/utils/unfurl.ts';
|
||||
import { renderStatus } from '@/views/mastodon/statuses.ts';
|
||||
|
||||
let trendingHashtagsCache = getTrendingHashtags();
|
||||
let trendingHashtagsCache = getTrendingHashtags().catch((e) => {
|
||||
console.error(`Failed to get trending hashtags: ${e}`);
|
||||
return Promise.resolve([]);
|
||||
});
|
||||
|
||||
Deno.cron('update trending hashtags cache', '35 * * * *', async () => {
|
||||
try {
|
||||
|
|
@ -52,7 +55,10 @@ async function getTrendingHashtags() {
|
|||
});
|
||||
}
|
||||
|
||||
let trendingLinksCache = getTrendingLinks();
|
||||
let trendingLinksCache = getTrendingLinks().catch((e) => {
|
||||
console.error(`Failed to get trending links: ${e}`);
|
||||
return Promise.resolve([]);
|
||||
});
|
||||
|
||||
Deno.cron('update trending links cache', '50 * * * *', async () => {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue