diff --git a/lib/followers/index.ts b/lib/followers/index.ts index 66c89dc..8bf7d22 100644 --- a/lib/followers/index.ts +++ b/lib/followers/index.ts @@ -1,4 +1,3 @@ -import { unstable_cache } from "next/cache"; import { getYoutubeSubscriberCount } from "./youtube"; import { getRobloxFollowerCount } from "./roblox"; import { getDiscordMemberCount } from "./discord"; @@ -17,27 +16,23 @@ export interface FetchResult { tiktokProfile: TiktokProfile; } -const getFollowerCountsFromAPIs = unstable_cache( - async (): Promise => { - const [youtube, roblox, discord, tiktokProfileResult] = await Promise.all([ - getYoutubeSubscriberCount(), - getRobloxFollowerCount(), - getDiscordMemberCount(), - getTiktokProfile(), - ]); +async function fetchFollowerCountsFromAPIs(): Promise { + const [youtube, roblox, discord, tiktokProfileResult] = await Promise.all([ + getYoutubeSubscriberCount(), + getRobloxFollowerCount(), + getDiscordMemberCount(), + getTiktokProfile(), + ]); - const counts: FollowerCounts = { - youtube, - roblox, - discord, - tiktok: tiktokProfileResult.followerCount, - }; - - return { counts, tiktokProfile: tiktokProfileResult }; - }, - ['follower-counts-api'], - { revalidate: 3600, tags: ['follower-counts-api'] } -); + const counts: FollowerCounts = { + youtube, + roblox, + discord, + tiktok: tiktokProfileResult.followerCount, + }; + + return { counts, tiktokProfile: tiktokProfileResult }; +} export async function getFollowerCounts(): Promise { try { @@ -57,7 +52,7 @@ export async function getFollowerCounts(): Promise { // Redis unavailable, fall through to fetch } - const result = await getFollowerCountsFromAPIs(); + const result = await fetchFollowerCountsFromAPIs(); try { const { getRedisClient } = await import("@/lib/redis");