mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-27 20:04:52 +02:00
Fix KeyValueStore::is_empty for disk.
This commit is contained in:
@@ -47,9 +47,12 @@ impl KeyValueStore {
|
||||
.map_err(KeyValueError::KVError)
|
||||
}
|
||||
|
||||
/// Returns true if this KeyValueStore (with this namespace) has any entries
|
||||
/// Returns true if this KeyValueStore (with this namespace) has any entries.
|
||||
pub fn is_empty(&self) -> Result<bool, KeyValueError> {
|
||||
self.execute(&Scope::global(), |kv| kv.is_empty())
|
||||
// NOTE: this is done using `self.execute` as this would result in a lockfile
|
||||
// to be created for disk based inner stores, and that would make them
|
||||
// appear as not empty.
|
||||
self.inner.is_empty().map_err(KeyValueError::KVError)
|
||||
}
|
||||
|
||||
/// Wipe the complete store. Needless to say perhaps.. use with care..
|
||||
|
||||
Reference in New Issue
Block a user