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.

function name change

Steven Tey3d20433e181a
diff --git a/lib/cron/domains.tsx b/lib/cron/domains.tsx
index 8a956be871..359862a9fb 100644
--- a/lib/cron/domains.tsx
+++ b/lib/cron/domains.tsx
@@ -5,7 +5,7 @@ import { log } from "@/lib/utils";
import { removeDomain } from "@/lib/domains";
import prisma from "@/lib/prisma";
import { deleteProjectLinks } from "@/lib/api/links";
-import { getClicks } from "@/lib/tinybird";
+import { getClicksUsage } from "@/lib/tinybird";
export const handleDomainUpdates = async (
projectSlug: string,
@@ -42,7 +42,7 @@ export const handleDomainUpdates = async (
}
if (invalidDays >= 30) {
- const clicks = await getClicks({ domain });
+ const clicks = await getClicksUsage({ domain });
// only delete if there are no clicks recorded in Tinybird
if (clicks === 0) {
const ownerEmail = await getProjectOwnerEmail(projectSlug);
diff --git a/lib/cron/usage.tsx b/lib/cron/usage.tsx
index f37deb4122..c222b76125 100644
--- a/lib/cron/usage.tsx
+++ b/lib/cron/usage.tsx
@@ -1,7 +1,7 @@
import sendMail from "emails";
import UsageExceeded from "emails/UsageExceeded";
import prisma from "@/lib/prisma";
-import { getClicks } from "@/lib/tinybird";
+import { getClicksUsage } from "@/lib/tinybird";
import { getFirstAndLastDay, log } from "@/lib/utils";
export const updateUsage = async () => {
@@ -155,7 +155,7 @@ const getUsage = async (
): Promise<number> => {
const { firstDay, lastDay } = getFirstAndLastDay(billingCycleStart);
- const usage = await getClicks({
+ const usage = await getClicksUsage({
domain,
start: firstDay.toISOString().replace("T", " ").replace("Z", ""),
end: lastDay.toISOString().replace("T", " ").replace("Z", ""),
diff --git a/lib/tinybird.ts b/lib/tinybird.ts
index c5ca13f66e..149087010f 100644
--- a/lib/tinybird.ts
+++ b/lib/tinybird.ts
@@ -60,7 +60,7 @@ export async function recordClick(
]);
}
-export async function getClicks({
+export async function getClicksUsage({
domain,
start,
end,