Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update route.ts

Steven Teyf3a2a58d8caf
diff --git a/apps/web/app/api/track/click/route.ts b/apps/web/app/api/track/click/route.ts
index 6306d9e4e1..a479d6b722 100644
--- a/apps/web/app/api/track/click/route.ts
+++ b/apps/web/app/api/track/click/route.ts
@@ -33,15 +33,15 @@ export const POST = async (req: Request) => {
});
}
- const redisKey = `trackClick:${link.id}:${ipAddress(req)}`;
- let clickId = await redis.get<string>(redisKey);
+ const cacheKey = `recordClick:${link.id}:${ipAddress(req)}`;
+ let clickId = await redis.get<string>(cacheKey);
if (!clickId) {
clickId = nanoid(16);
waitUntil(
Promise.allSettled([
- redis.set(redisKey, clickId, {
+ redis.set(cacheKey, clickId, {
ex: 60 * 60,
}), // 1 hour
recordClick({