Merge pull request #1151 from useautumn/fix/dryrun-autotopups

fix: dryrun autotopups
This commit is contained in:
John Yeo
2026-04-01 13:44:55 +01:00
committed by GitHub
2 changed files with 9 additions and 0 deletions

View File

@@ -63,6 +63,14 @@ export const autoTopup = async ({
billingContext: autoTopupContext,
});
if (org.config.dryrun_autotopups) {
logger.info(
`[autoTopup] Dry run enabled, skipping recordAutoTopupAttempt`,
{ extras: ctx.extraLogs },
);
return;
}
let billingResult: Awaited<ReturnType<typeof executeBillingPlan>>;
billingResult = await executeBillingPlan({
ctx,

View File

@@ -32,6 +32,7 @@ export const OrgConfigSchema = z.object({
disable_stripe_writes: z.boolean().default(false),
disabled_auto_topup: z.boolean().default(false),
dryrun_autotopups: z.boolean().default(false),
});
export type OrgConfig = z.infer<typeof OrgConfigSchema>;