mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
resolved greptile issue related to regeneration persistence and exception handling
This commit is contained in:
parent
fef5c5fd3e
commit
fa95853718
2 changed files with 15 additions and 16 deletions
|
|
@ -357,9 +357,11 @@ async def get_api_key_metadata(
|
|||
"key_alias": k.key_alias,
|
||||
"team_id": k.team_id,
|
||||
}
|
||||
except Exception:
|
||||
verbose_proxy_logger.debug(
|
||||
"Failed to fetch deleted key metadata for missing keys"
|
||||
except Exception as e:
|
||||
verbose_proxy_logger.warning(
|
||||
"Failed to fetch deleted key metadata for %d missing keys: %s",
|
||||
len(missing_keys),
|
||||
e,
|
||||
)
|
||||
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -3313,19 +3313,16 @@ async def regenerate_key_fn(
|
|||
|
||||
verbose_proxy_logger.debug("key_in_db: %s", _key_in_db)
|
||||
|
||||
# Save the old key record to deleted table before regeneration
|
||||
# This preserves key_alias and team_id metadata for historical spend records
|
||||
try:
|
||||
await _persist_deleted_verification_tokens(
|
||||
keys=[_key_in_db],
|
||||
prisma_client=prisma_client,
|
||||
user_api_key_dict=user_api_key_dict,
|
||||
litellm_changed_by=litellm_changed_by,
|
||||
)
|
||||
except Exception:
|
||||
verbose_proxy_logger.debug(
|
||||
"Failed to persist old key record to deleted table during regeneration"
|
||||
)
|
||||
# Save the old key record to deleted table before regeneration.
|
||||
# This preserves key_alias and team_id metadata for historical spend records.
|
||||
# If this fails, abort the regeneration to avoid permanently losing the
|
||||
# old hash→metadata mapping.
|
||||
await _persist_deleted_verification_tokens(
|
||||
keys=[_key_in_db],
|
||||
prisma_client=prisma_client,
|
||||
user_api_key_dict=user_api_key_dict,
|
||||
litellm_changed_by=litellm_changed_by,
|
||||
)
|
||||
|
||||
new_token = get_new_token(data=data)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue