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

Kiran K216b1e97ae81
diff --git a/apps/web/app/api/cron/links/invalidate-for-discounts/route.ts b/apps/web/app/api/cron/links/invalidate-for-discounts/route.ts
index f9ff0cb07d..6928090830 100644
--- a/apps/web/app/api/cron/links/invalidate-for-discounts/route.ts
+++ b/apps/web/app/api/cron/links/invalidate-for-discounts/route.ts
@@ -1,5 +1,5 @@
import { handleAndReturnErrorResponse } from "@/lib/api/errors";
-import { CACHE_EXPIRATION, linkCache } from "@/lib/api/links/cache";
+import { linkCache } from "@/lib/api/links/cache";
import { verifyQstashSignature } from "@/lib/cron/verify-qstash";
import { redis } from "@/lib/upstash";
import { prisma } from "@dub/prisma";
@@ -46,18 +46,6 @@ export async function POST(req: Request) {
programEnrollment: {
discountId: isDefault ? null : discountId,
},
- OR: [
- {
- updatedAt: {
- gt: new Date(Date.now() - CACHE_EXPIRATION * 1000),
- },
- },
- {
- lastClicked: {
- gt: new Date(Date.now() - CACHE_EXPIRATION * 1000),
- },
- },
- ],
},
select: {
domain: true,
@@ -113,18 +101,6 @@ export async function POST(req: Request) {
}),
discountId: null,
},
- OR: [
- {
- updatedAt: {
- gt: new Date(Date.now() - CACHE_EXPIRATION * 1000),
- },
- },
- {
- lastClicked: {
- gt: new Date(Date.now() - CACHE_EXPIRATION * 1000),
- },
- },
- ],
},
select: {
domain: true,