fix: fix posthog, add dummy crawl DB items

This commit is contained in:
Gergő Móricz
2024-08-15 18:55:18 +02:00
parent 8a5cad72f6
commit 846610681b
4 changed files with 42 additions and 2 deletions
+1 -2
View File
@@ -44,7 +44,7 @@ export async function logJob(job: FirecrawlJob) {
},
]);
if (process.env.POSTHOG_API_KEY) {
if (process.env.POSTHOG_API_KEY && !job.crawl_id) {
let phLog = {
distinctId: "from-api", //* To identify this on the group level, setting distinctid to a static string per posthog docs: https://posthog.com/docs/product-analytics/group-analytics#advanced-server-side-only-capturing-group-events-without-a-user
...(job.team_id !== "preview" && {
@@ -65,7 +65,6 @@ export async function logJob(job: FirecrawlJob) {
extractor_options: job.extractor_options,
num_tokens: job.num_tokens,
retry: job.retry,
crawl_id: job.crawl_id,
},
};
posthog.capture(phLog);