fix: reconcile Huihui payment callbacks after provider confirmation

This commit is contained in:
stefanfeng
2026-10-20 14:27:49 +08:00
parent 23d9a33a6d
commit 5c992729c4
6 changed files with 220 additions and 21 deletions
+20
View File
@@ -282,6 +282,19 @@ def close_expired_pending_orders_job():
db.close()
def reconcile_huihui_org_notices_job():
db = SessionLocal()
try:
count = routers.tokens.reconcile_huihui_org_notices(db)
if count:
logger.info("Confirmed %s Huihui organization payment notice(s)", count)
except Exception as exc:
db.rollback()
logger.warning("Failed to reconcile Huihui organization payment notices: %s", exc)
finally:
db.close()
def start_maintenance_scheduler():
global maintenance_scheduler
@@ -305,6 +318,13 @@ def start_maintenance_scheduler():
max_instances=1,
coalesce=True,
)
maintenance_scheduler.add_job(
reconcile_huihui_org_notices_job,
trigger=IntervalTrigger(seconds=30),
id="reconcile_huihui_org_notices",
max_instances=1,
coalesce=True,
)
maintenance_scheduler.start()