Merge remote-tracking branch 'origin/main' into temp-wildcard

This commit is contained in:
Clément Renault 2023-02-09 13:14:05 +01:00
commit 4570d5bf3a
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
164 changed files with 8353 additions and 2473 deletions

View file

@ -3,7 +3,6 @@ use std::cmp::Reverse;
use std::collections::HashSet;
use std::convert::{TryFrom, TryInto};
use std::fs::create_dir_all;
use std::ops::Deref;
use std::path::Path;
use std::str;
use std::sync::Arc;
@ -61,6 +60,11 @@ impl HeedAuthStore {
Ok(Self { env, keys, action_keyid_index_expiration, should_close_on_drop: true })
}
/// Return the size in bytes of database
pub fn size(&self) -> Result<u64> {
Ok(self.env.real_disk_size()?)
}
pub fn set_drop_on_close(&mut self, v: bool) {
self.should_close_on_drop = v;
}
@ -135,7 +139,7 @@ impl HeedAuthStore {
for index in key.indexes.iter() {
db.put(
&mut wtxn,
&(&uid, &action, Some(index.deref().as_bytes())),
&(&uid, &action, Some(index.to_string().as_bytes())),
&key.expires_at,
)?;
}