improve internal item counter mechanisms and implement bucket quotas #326
1 changed files with 4 additions and 2 deletions
|
@ -259,8 +259,10 @@ async fn check_quotas(
|
|||
if let Some(ms) = quotas.max_size {
|
||||
let current_size = counters.get(BYTES).cloned().unwrap_or_default();
|
||||
if cnt_size_diff > 0 && current_size + cnt_size_diff > ms as i64 {
|
||||
return Err(Error::forbidden(format!("Bucket size quota is reached, maximum total sie of objects for this bucket: {}. The bucket is already {} bytes, and this object would add {} bytes.", ms,
|
||||
current_size, size)));
|
||||
return Err(Error::forbidden(format!(
|
||||
"Bucket size quota is reached, maximum total sie of objects for this bucket: {}. The bucket is already {} bytes, and this object would add {} bytes.",
|
||||
ms, current_size, size
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue