import 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("/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]"); }