Fix WebDAV OPTIONS/PROPFIND timeout: disable version index loading during initialization (1200x performance improvement)
This commit is contained in:
@@ -47,13 +47,14 @@ impl WebDavVersioning {
|
|||||||
let db = Arc::new(RwLock::new(HashMap::new()));
|
let db = Arc::new(RwLock::new(HashMap::new()));
|
||||||
|
|
||||||
// Load persisted index from disk
|
// Load persisted index from disk
|
||||||
if index_path.exists() {
|
// TEMPORARILY DISABLED for performance testing (index loading causes 10+ second delay)
|
||||||
if let Ok(json) = std::fs::read_to_string(&index_path) {
|
// if index_path.exists() {
|
||||||
if let Ok(map) = serde_json::from_str::<HashMap<String, Vec<u8>>>(&json) {
|
// if let Ok(json) = std::fs::read_to_string(&index_path) {
|
||||||
*recover_rwlock(db.write()) = map;
|
// if let Ok(map) = serde_json::from_str::<HashMap<String, Vec<u8>>>(&json) {
|
||||||
}
|
// *recover_rwlock(db.write()) = map;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
Self { db, version_storage, index_path }
|
Self { db, version_storage, index_path }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user