From 11475d31c3bbdc4876b9146ce5146bce3f48a0de Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 4 Aug 2026 18:36:10 +0800 Subject: [PATCH] feat(balance): invalidate llmage Redis balance cache after recharge --- accounting/recharge.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accounting/recharge.py b/accounting/recharge.py index ee87d8f..ba4bd7a 100644 --- a/accounting/recharge.py +++ b/accounting/recharge.py @@ -62,6 +62,12 @@ class RechargeBiz(PFBiz): ao = Accounting(self) await self.write_bill(sor) await ao.do_accounting(sor) + # Invalidate llmage Redis balance cache so reserve sees new balance + try: + from llmage.balance import invalidate_balance_cache + await invalidate_balance_cache(self.customerid) + except Exception as e: + debug(f'llmage balance cache invalidate skipped: {e}') return True async def write_bill(self, sor):