datastore: add check for maintenance in lookup

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
Hannes Laimer
2022-04-12 05:25:57 +00:00
committed by Thomas Lamprecht
parent 2a05c75ff1
commit e9d2fc9362
13 changed files with 86 additions and 54 deletions

View File

@ -48,7 +48,7 @@ use proxmox_time::CalendarEvent;
use pbs_api_types::{
Authid, DataStoreConfig, PruneOptions, SyncJobConfig, TapeBackupJobConfig,
VerificationJobConfig,
VerificationJobConfig, Operation
};
use proxmox_rest_server::daemon;
@ -560,7 +560,7 @@ async fn schedule_datastore_garbage_collection() {
};
for (store, (_, store_config)) in config.sections {
let datastore = match DataStore::lookup_datastore(&store) {
let datastore = match DataStore::lookup_datastore(&store, Some(Operation::Write)) {
Ok(datastore) => datastore,
Err(err) => {
eprintln!("lookup_datastore failed - {}", err);