feat: implement distributed caching

This commit is contained in:
mrjvs
2026-08-19 13:48:47 +02:00
parent 2390b6c6fd
commit 5a31197dcf
8 changed files with 134 additions and 32 deletions

View File

@@ -1,5 +1,6 @@
import { getGithubProjects } from '../utils/getGithubProgress';
import { getStripeDonations } from '../utils/getStripeDonations';
import { useCacher } from '../utils/cache';
import type { GetProgress, ProgressItem } from '#shared/api-types';
const donationGoalCents = 3000 * 100;
@@ -7,8 +8,9 @@ const donationGoalCents = 3000 * 100;
export default defineEventHandler(async (event): Promise<GetProgress> => {
const octokit = useOctokit(event);
const stripe = useStripe(event);
const donationData = await getStripeDonations(stripe);
const { projects } = await getGithubProjects(octokit);
const cacher = useCacher(event);
const donationData = await getStripeDonations(cacher, stripe);
const { projects } = await getGithubProjects(cacher, octokit);
const items: ProgressItem[] = projects.map((v) => {
const totalTasks = v.tasks.length;