mirror of
https://github.com/mCaptcha/cache.git
synced 2024-11-21 16:25:19 +03:00
delete bucket safety after decrement
This commit is contained in:
parent
fa50b22673
commit
65b8fdfc10
1 changed files with 10 additions and 3 deletions
|
@ -147,9 +147,16 @@ impl Bucket {
|
|||
let bucket = ctx.open_key_writable(&bucket_name);
|
||||
Bucket::decrement_runner(ctx, &bucket);
|
||||
|
||||
match bucket.delete() {
|
||||
Err(e) => ctx.log_warning(&format!("enountered error while deleting hashmap: {:?}", e)),
|
||||
Ok(_) => (),
|
||||
if let Err(e) = bucket.delete() {
|
||||
ctx.log_warning(&format!("enountered error while deleting hashmap: {:?}", e));
|
||||
}
|
||||
|
||||
let timer = ctx.open_key_writable(&get_timer_name_from_bucket_name(&bucket_name));
|
||||
if let Err(e) = timer.delete() {
|
||||
ctx.log_warning(&format!(
|
||||
"enountered error while deleting bucket tiemr: {:?}",
|
||||
e
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue