Remove multiple files from the FILE_INDEX in a single write transaction. This is much faster than calling `del_file_index()` in a loop because it avoids a separate write transaction (and fsync) for each file. # Arguments `paths` - Paths to remove from the index
(&self, paths: &[&str])
| 548 | /// |
| 549 | /// * `paths` - Paths to remove from the index |
| 550 | pub fn del_file_index_batch(&self, paths: &[&str]) -> Result<(), RepositoryError> { |
| 551 | if paths.is_empty() { |
| 552 | return Ok(()); |
| 553 | } |
| 554 | |
| 555 | let mut txn = self |
| 556 | .pristine |
| 557 | .write_txn() |
| 558 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 559 | |
| 560 | for path in paths { |
| 561 | let normalized = path.replace('\\', "/"); |
| 562 | let _ = txn.del_file_index(&normalized); |
| 563 | } |
| 564 | |
| 565 | txn.commit() |
| 566 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 567 | |
| 568 | Ok(()) |
| 569 | } |
| 570 | |
| 571 | /// Store mtime + size + content hash for a batch of files in a single transaction. |
| 572 | /// |
no test coverage detected