Implement incremental save for WebDAV versioning

Changes:
1. Added dirty flag to WebDavVersioning to track unsaved changes
2. Modified create_version() to only mark dirty=true instead of immediate save_index()
3. Added flush() method to save dirty index periodically
4. Added background thread in server.rs to flush every 60 seconds
5. Async index loading on startup (spawn thread to avoid blocking OPTIONS/PROPFIND)

Expected performance:
- PUT operations: still fast (dirty flag only, no save_index() blocking)
- Index persistence: flush every 60 seconds (or on shutdown)
- OPTIONS/PROPFIND: no blocking (async index loading)

Test results:
- PUT (31B): 0.053s (53ms) 
- Index loading: async thread started 
- Flush thread: started but blocked by launchd auto-restart ⚠️

Next: Test flush thread in production environment (without launchd)
This commit is contained in:
Warren
2026-06-30 05:29:09 +08:00
parent 86984295bf
commit 65cd68cad4
6 changed files with 49 additions and 13 deletions

Binary file not shown.