Disable daily churn analysis cron
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Workflows (Fly.io) / deploy (push) Has been cancelled

This commit is contained in:
Baptiste Arnaud 2026-07-04 09:35:25 +02:00
parent 9d2d7ead8e
commit fa2e2e92f4
No known key found for this signature in database
2 changed files with 0 additions and 29 deletions

View File

@ -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:

View File

@ -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();