From fa2e2e92f4bf62d3342e3315309d9381f288fbb5 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Sat, 4 Jul 2026 09:35:25 +0200 Subject: [PATCH] Disable daily churn analysis cron --- .github/workflows/daily.yml | 1 - packages/scripts/src/cronJobs/daily.tsx | 28 ------------------------- 2 files changed, 29 deletions(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index f05763665..900f1d350 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -23,7 +23,6 @@ jobs: POSTHOG_API_HOST: "${{ secrets.POSTHOG_API_HOST }}" POSTHOG_PERSONAL_API_KEY: "${{ secrets.POSTHOG_PERSONAL_API_KEY }}" STRIPE_SECRET_KEY: "${{ secrets.STRIPE_SECRET_KEY }}" - OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}" DISCORD_CHANNEL_ID: "${{ secrets.DISCORD_CHANNEL_ID }}" DISCORD_BOT_TOKEN: "${{ secrets.DISCORD_BOT_TOKEN }}" steps: diff --git a/packages/scripts/src/cronJobs/daily.tsx b/packages/scripts/src/cronJobs/daily.tsx index 04cf337c9..8cddd01ef 100644 --- a/packages/scripts/src/cronJobs/daily.tsx +++ b/packages/scripts/src/cronJobs/daily.tsx @@ -1,5 +1,3 @@ -import { formatChurnAgentDiscordMessages } from "../churnAgent/formatChurnAgentDiscordMessages"; -import { getYesterdayChurnSummary } from "../churnAgent/getYesterdayChurnSummary"; import { cleanExpiredData } from "../helpers/cleanExpiredData"; import { formatSubscriptionMessage } from "../helpers/formatSubscriptionMessage"; import { getLandingPageVisitors } from "../helpers/getLandingPageVisitors"; @@ -32,32 +30,6 @@ ${formatSubscriptionMessage(subscriptionTransitions)} channelId: process.env.DISCORD_CHANNEL_ID!, }, ); - - if (!process.env.DISCORD_CHANNEL_ID) { - console.log("DISCORD_CHANNEL_ID is not set, skipping churn agent"); - return; - } - - await getYesterdayChurnSummary({ - onSummaryGenerated: async (churnSummary) => { - const totalSpent = churnSummary.workspace.totalSpent - ? parseFloat( - churnSummary.workspace.totalSpent.replace(/[^0-9.-]+/g, ""), - ) - : 0; - - const isLowSpender = totalSpent < 100; - await sendDiscordMessage( - formatChurnAgentDiscordMessages(churnSummary, { - excludeTimeline: isLowSpender, - excludeEmailSuggestion: isLowSpender, - }), - { - channelId: process.env.DISCORD_CHANNEL_ID!, - }, - ); - }, - }); }; main().then();