mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
get_all_update_transactions_from_redis
This commit is contained in:
parent
963791bbb5
commit
e65b708fa2
1 changed files with 27 additions and 2 deletions
|
@ -106,5 +106,30 @@ class RedisUpdateBuffer:
|
|||
value=transaction_amount,
|
||||
)
|
||||
|
||||
async def get_all_update_transactions_from_redis(self):
|
||||
pass
|
||||
async def get_all_update_transactions_from_redis(
|
||||
self,
|
||||
) -> Optional[DBSpendUpdateTransactions]:
|
||||
"""
|
||||
Gets all the update transactions from Redis
|
||||
"""
|
||||
if self.redis_cache is None:
|
||||
return None
|
||||
expected_keys = [
|
||||
"user_list_transactons",
|
||||
"end_user_list_transactons",
|
||||
"key_list_transactons",
|
||||
"team_list_transactons",
|
||||
"team_member_list_transactons",
|
||||
"org_list_transactons",
|
||||
]
|
||||
result = await self.redis_cache.async_batch_get_cache(expected_keys)
|
||||
if result is None:
|
||||
return None
|
||||
return DBSpendUpdateTransactions(
|
||||
user_list_transactons=result.get("user_list_transactons", {}),
|
||||
end_user_list_transactons=result.get("end_user_list_transactons", {}),
|
||||
key_list_transactons=result.get("key_list_transactons", {}),
|
||||
team_list_transactons=result.get("team_list_transactons", {}),
|
||||
team_member_list_transactons=result.get("team_member_list_transactons", {}),
|
||||
org_list_transactons=result.get("org_list_transactons", {}),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue