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.

add /api/cron/domains/update

Kiran K88503cf93c40
diff --git a/apps/web/app/api/cron/domains/update/route.ts b/apps/web/app/api/cron/domains/update/route.ts
index 8894a0e66e..d3a634bf8d 100644
--- a/apps/web/app/api/cron/domains/update/route.ts
+++ b/apps/web/app/api/cron/domains/update/route.ts
@@ -83,11 +83,9 @@ export async function POST(req: Request) {
oldDomain,
newDomain,
page: page + 1,
- delay: 1000,
+ delay: 2,
});
- console.log(`Updated page ${page + 1} of links for domain ${oldDomain}`);
-
return new Response("Domain's links updated.");
} catch (error) {
return handleAndReturnErrorResponse(error);
diff --git a/apps/web/app/api/links/bulk/route.ts b/apps/web/app/api/links/bulk/route.ts
index be8c764e3f..85298ff897 100644
--- a/apps/web/app/api/links/bulk/route.ts
+++ b/apps/web/app/api/links/bulk/route.ts
@@ -401,8 +401,6 @@ export const DELETE = withWorkspace(
},
});
- console.log(links);
-
const { count: deletedCount } = await prisma.link.deleteMany({
where: {
id: { in: links.map((link) => link.id) },
diff --git a/apps/web/lib/api/links/cache.ts b/apps/web/lib/api/links/cache.ts
index fc82a9f82d..28a11fb244 100644
--- a/apps/web/lib/api/links/cache.ts
+++ b/apps/web/lib/api/links/cache.ts
@@ -89,9 +89,7 @@ class LinkCache {
const oldCacheKey = this._createKey({ domain: oldDomain, key });
const newCacheKey = this._createKey({ domain, key });
- console.log(`Renaming ${oldCacheKey} to ${newCacheKey}`);
-
- pipeline.rename(oldCacheKey, newCacheKey);
+ pipeline.renamenx(oldCacheKey, newCacheKey);
});
return await pipeline.exec();