mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-25 18:48:58 -06:00
chore: fast return ping endpoint when telemetry is disabled (#5893)
Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { responses } from "@/app/lib/api/response";
|
||||
import { CRON_SECRET } from "@/lib/constants";
|
||||
import { env } from "@/lib/env";
|
||||
import { captureTelemetry } from "@/lib/telemetry";
|
||||
import packageJson from "@/package.json";
|
||||
import { headers } from "next/headers";
|
||||
@@ -13,6 +14,10 @@ export const POST = async () => {
|
||||
return responses.notAuthenticatedResponse();
|
||||
}
|
||||
|
||||
if (env.TELEMETRY_DISABLED === "1") {
|
||||
return responses.successResponse({}, true);
|
||||
}
|
||||
|
||||
const [surveyCount, responseCount, userCount] = await Promise.all([
|
||||
prisma.survey.count(),
|
||||
prisma.response.count(),
|
||||
|
||||
Reference in New Issue
Block a user