datastore: add new Lookup for operations tracking

We sometimes need to do some in-memory only stuff, e.g., to check if
GC is already running for a datastore, which is a try_lock on a mutex
that is in-memory.

Actually the whole thing would be nicer if we could guarantee to hold
the correct contract statically, e.g., like
https://docs.rust-embedded.org/book/static-guarantees/design-contracts.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2022-05-12 11:31:07 +02:00
parent d4d730e589
commit 0408f60b58
3 changed files with 21 additions and 2 deletions

View File

@ -133,7 +133,7 @@ impl DataStore {
if let Some(maintenance_mode) = config.get_maintenance_mode() {
if let Err(error) = maintenance_mode.check(operation) {
bail!("datastore '{}' is in {}", name, error);
bail!("datastore '{name}' is in {error}");
}
}