feat(logging): add LOG_ADMIN_HIDE setting and update logging functionality
Introduce a new configuration option `LOG_ADMIN_HIDE` to control the visibility of admin-generated events in the logs. Update the logging retrieval functions to respect this setting, ensuring that admin actions can be hidden from the "All message logs" UI and CSV exports. Additionally, enhance the README with detailed logging configuration options for better clarity.
This commit is contained in:
@@ -645,8 +645,20 @@ async def yookassa_webhook_route(request: web.Request):
|
||||
yookassa_service,
|
||||
lknpd_service)
|
||||
if not processed:
|
||||
await session.rollback()
|
||||
return web.Response(status=503, text="yookassa_processing_failed_retry")
|
||||
# process_successful_payment uses False for permanent business failures
|
||||
# (e.g. user not found / metadata issues) and may have already updated
|
||||
# the payment status. Commit the status and ACK the webhook to stop
|
||||
# indefinite provider retries.
|
||||
try:
|
||||
await session.commit()
|
||||
except Exception:
|
||||
await session.rollback()
|
||||
logging.exception(
|
||||
"Failed to commit failure status for YooKassa payment %s",
|
||||
payment_dict_for_processing.get("id"),
|
||||
)
|
||||
return web.Response(status=503, text="yookassa_processing_failed_retry")
|
||||
return web.Response(status=200, text="ok")
|
||||
await session.commit()
|
||||
else:
|
||||
logging.warning(
|
||||
|
||||
Reference in New Issue
Block a user