Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Nov 10, 2024
1 parent e2017fd commit b858110
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/get-tweets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ async function getTweetImpl(tweetId: string): Promise<any> {
try {
try {
const cachedTweet = await db.get(cacheKey)
if (cachedTweet) {
if (cachedTweet || cachedTweet === null) {
return cachedTweet
}
} catch (err) {
// ignore redis errors
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)
Expand Down

0 comments on commit b858110

Please sign in to comment.