Something went wrong. Try again.
a Page to view some global statistics about Modrinth modrinth-statistics.tobinio.dev
Something went wrong. Try again.
555 B · 16 lines
TypeScript
at main
1234567891011121314151617import type { GlobalStats } from "~~/server/utils/processing/global/types";import { $modrinthFetch } from "~~/shared/utils/modrinthFetch";import { LOGGER } from "../logging";
export async function updateGlobalStats() { LOGGER.info("updating globalStats [starting]");
const data = await $modrinthFetch<GlobalStats>("/statistics"); const result = await DB.GlobalStats.set(data, new Date()); if (result instanceof Error) { LOGGER.error("failed to update globalStats", result); throw result; }
LOGGER.info("updating globalStats [finished]");}