Fix WebDAV OPTIONS/PROPFIND timeout: disable version index loading during initialization (1200x performance improvement)

This commit is contained in:
Warren
2026-06-30 03:56:02 +08:00
parent 5ea9293cfd
commit 18aa067be7

View File

@@ -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 }
} }