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()));
|
||||
|
||||
// Load persisted index from disk
|
||||
if index_path.exists() {
|
||||
if let Ok(json) = std::fs::read_to_string(&index_path) {
|
||||
if let Ok(map) = serde_json::from_str::<HashMap<String, Vec<u8>>>(&json) {
|
||||
*recover_rwlock(db.write()) = map;
|
||||
}
|
||||
}
|
||||
}
|
||||
// TEMPORARILY DISABLED for performance testing (index loading causes 10+ second delay)
|
||||
// if index_path.exists() {
|
||||
// if let Ok(json) = std::fs::read_to_string(&index_path) {
|
||||
// if let Ok(map) = serde_json::from_str::<HashMap<String, Vec<u8>>>(&json) {
|
||||
// *recover_rwlock(db.write()) = map;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
Self { db, version_storage, index_path }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user