From b8581108b15f4e18047df2733128ed1a66c60e10 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Sun, 10 Nov 2024 16:14:23 +0700 Subject: [PATCH] =?UTF-8?q?=E2=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/get-tweets.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/get-tweets.ts b/lib/get-tweets.ts index 9618266e3e..9234f3420e 100644 --- a/lib/get-tweets.ts +++ b/lib/get-tweets.ts @@ -35,7 +35,7 @@ async function getTweetImpl(tweetId: string): Promise { try { try { const cachedTweet = await db.get(cacheKey) - if (cachedTweet) { + if (cachedTweet || cachedTweet === null) { return cachedTweet } } catch (err) { @@ -43,7 +43,7 @@ async function getTweetImpl(tweetId: string): Promise { console.warn(`redis error get "${cacheKey}"`, err.message) } - const tweetData = await getTweetData(tweetId) + const tweetData = (await getTweetData(tweetId)) || null try { await db.set(cacheKey, tweetData)