Scheduled Postgres backup, restore check, backup warnings in health, payment result logging

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 17:32:06 +03:30
parent a5feee053a
commit 7d81d193bd
11 changed files with 449 additions and 5 deletions

View File

@@ -212,6 +212,14 @@ def apply_order_payment_result(*, order: Order, gateway: str, gateway_ref_id: st
event=event, user_id=order.user_id,
)
# یک خطِ لاگِ فنی برای هر نتیجه، تکراری‌ها هم: در دیتابیس فقط نتیجه‌ی پذیرفته‌شده ردیف دارد
# (Transaction/StatusChangeLog)، پس کال‌بکِ تکراری یا جعلی بی‌این خط هیچ ردی نداشت.
logger.log(
logging.WARNING if is_duplicate and new_status == 'paid' and not already_paid else logging.INFO,
'payment result: order=%s user=%s gateway=%s event=%s status=%s->%s ref=%s ignored=%s',
order.id, order.user_id, gateway, event, old_status, new_status,
gateway_ref_id or '-', is_duplicate,
)
newly_paid = new_status == 'paid' and not already_paid and not is_duplicate
if newly_paid:
if order.subscription_id: