Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d7ecea9

Browse filesBrowse files
committed
added comment
1 parent 9df5a82 commit d7ecea9
Copy full SHA for d7ecea9

File tree

1 file changed

+4
-1
lines changed
Filter options

1 file changed

+4
-1
lines changed

‎lib/upstash.ts

Copy file name to clipboardExpand all lines: lib/upstash.ts
+4-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ export async function setLastCheckedId(id: number) {
113113
}
114114

115115
export async function checkIfPostWasChecked(id: number) {
116-
/* Check if a post has been checked in redis – if setting the key for the post returns null, it means it's already been set */
116+
/* Check if a post has been checked in redis – 
117+
if setting the key for the post returns null, it means it's already been set
118+
Here, we're setting the keys to expire in 24 hours
119+
*/
117120
return (
118121
(await redis.set(`post_${id}`, true, { nx: true, ex: 24 * 60 * 60 })) ===
119122
null

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.