mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-17 23:51:30 +00:00
fix(proxy): log audit log failures in /user/bulk_delete instead of dropping them
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
cd9c39921b
commit
beaa96fc8f
1 changed files with 4 additions and 1 deletions
|
|
@ -301,7 +301,7 @@ async def _delete_user_rows(
|
|||
litellm_changed_by: str | None,
|
||||
) -> None:
|
||||
user_ids: Final = frozenset(u.user_id for u in users)
|
||||
await _bounded(
|
||||
audit_outcomes: Final = await _bounded(
|
||||
UserManagementEventHooks.create_internal_user_audit_log(
|
||||
user_id=u.user_id,
|
||||
action="deleted",
|
||||
|
|
@ -312,6 +312,9 @@ async def _delete_user_rows(
|
|||
)
|
||||
for u in users
|
||||
)
|
||||
for u, outcome in zip(users, audit_outcomes, strict=True):
|
||||
if isinstance(outcome, BaseException):
|
||||
verbose_proxy_logger.warning("Failed to create audit log for user %s: %s", u.user_id, outcome)
|
||||
keys: Final = await VerificationTokenRepository(prisma_client).table.find_many(
|
||||
where=_in_filter("user_id", user_ids)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue