fix: only add delta bytes when changing app data value
This commit is contained in:
parent
270d7550d6
commit
d58e47cbbe
2 changed files with 9 additions and 2 deletions
|
@ -160,7 +160,14 @@ pub async fn update_value_request(
|
|||
}
|
||||
|
||||
// ...
|
||||
if let Err(e) = data.add_app_data_used(app.id, req.value.len() as i32).await {
|
||||
// we only need to add the delta size (the next size - the old size)
|
||||
if let Err(e) = data
|
||||
.add_app_data_used(
|
||||
app.id,
|
||||
(req.value.len() as i32) - (app_data.value.len() as i32),
|
||||
)
|
||||
.await
|
||||
{
|
||||
return Json(e.into());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue