The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
skipRedisCache
Steven Tey7e2a28e02f68
diff --git a/apps/web/app/api/cron/import/bitly/utils.ts b/apps/web/app/api/cron/import/bitly/utils.tsindex a8090ab92c..9dfbcd392c 100644--- a/apps/web/app/api/cron/import/bitly/utils.ts+++ b/apps/web/app/api/cron/import/bitly/utils.ts@@ -203,7 +203,7 @@ export const importLinksFromBitly = async ({);// bulk create links- await bulkCreateLinks({ links: linksToCreate });+ await bulkCreateLinks({ links: linksToCreate, skipRedisCache: true });// only for buff.ly: check if previously created links (without case sensitivity) exists, if so, delete them + expire their cacheif (domains.includes("buff.ly")) {diff --git a/apps/web/lib/middleware/bitly.ts b/apps/web/lib/middleware/bitly.tsdeleted file mode 100644index 8c11bdbcba..0000000000--- a/apps/web/lib/middleware/bitly.ts+++ /dev/null@@ -1,27 +0,0 @@-import { APP_DOMAIN } from "@dub/utils";-import { EdgeLinkProps } from "../planetscale";--// Create a new Bitly-hosted link to Dub on-demand (e.g. buff.ly)-export const importBitlyLink = async ({- domain,- key,-}: {- domain: string;- key: string;-}) => {- try {- const result = await fetch(`${APP_DOMAIN}/api/links/crawl/bitly`, {- method: "POST",- body: JSON.stringify({ domain, key }),- });-- if (result.status === 404) {- return null;- }-- return (await result.json()) as EdgeLinkProps;- } catch (e) {- console.error("[Bitly] Error crawling Bitly link", e);- return null;- }-};