feat(balance): invalidate llmage Redis balance cache after recharge

This commit is contained in:
yumoqing 2026-08-04 18:36:10 +08:00
parent 16fdf90513
commit 11475d31c3

View File

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