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.

fix isRateLimited logic

Steven Teyc2113759f1e9
diff --git a/apps/web/app/api/cron/import/bitly/utils.ts b/apps/web/app/api/cron/import/bitly/utils.ts
index fb50e45ff0..6df37d292b 100644
--- a/apps/web/app/api/cron/import/bitly/utils.ts
+++ b/apps/web/app/api/cron/import/bitly/utils.ts
@@ -55,7 +55,6 @@ export const importLinksFromBitly = async ({
},
);
-
if (!response.ok && response.status === 429) {
return await queueBitlyImport({
workspaceId,
@@ -329,7 +328,7 @@ export const checkIfRateLimited = async (bitlyApiKey: unknown, body: any) => {
console.log("checkIfRateLimited", endpoint);
- const isRateLimited = limit - currentUsage === 0;
+ const isRateLimited = currentUsage >= limit;
if (isRateLimited) {
await queueBitlyImport({