mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-11 15:05:47 +00:00
fix(proxy/utils.py): handle item not existing during batch updates
This commit is contained in:
@@ -722,9 +722,14 @@ class PrismaClient:
|
||||
data_json = self.jsonify_object(data=user.model_dump())
|
||||
except:
|
||||
data_json = self.jsonify_object(data=user.dict())
|
||||
batcher.litellm_usertable.update(
|
||||
batcher.litellm_usertable.upsert(
|
||||
where={"user_id": user.user_id}, # type: ignore
|
||||
data={**data_json}, # type: ignore
|
||||
data={
|
||||
"create": {**data_json}, # type: ignore
|
||||
"update": {
|
||||
**data_json # type: ignore
|
||||
}, # just update user-specified values, if it already exists
|
||||
},
|
||||
)
|
||||
await batcher.commit()
|
||||
verbose_proxy_logger.info(
|
||||
|
||||
Reference in New Issue
Block a user