Skip to content

Commit 96323e9

Browse files
committed
Settings: show live index size during scans
- Include WAL and SHM sidecar sizes in `db_file_size()` — previously only measured the main `.db` file, which stays flat during active writes in WAL mode - Reduce settings polling interval from 5s to 2s for snappier updates
1 parent d987cc8 commit 96323e9

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

apps/desktop/src-tauri/src/indexing/store.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,16 @@ impl IndexStore {
502502
&self.read_conn
503503
}
504504

505-
/// Return the DB file size on disk (bytes).
505+
/// Return the total DB size on disk (main file + WAL + SHM sidecars).
506506
pub fn db_file_size(&self) -> Result<u64, IndexStoreError> {
507-
Ok(std::fs::metadata(&self.db_path)?.len())
507+
let main = std::fs::metadata(&self.db_path)?.len();
508+
let wal = std::fs::metadata(format!("{}-wal", self.db_path.display()))
509+
.map(|m| m.len())
510+
.unwrap_or(0);
511+
let shm = std::fs::metadata(format!("{}-shm", self.db_path.display()))
512+
.map(|m| m.len())
513+
.unwrap_or(0);
514+
Ok(main + wal + shm)
508515
}
509516

510517
// ── Read methods (integer-keyed, new API) ────────────────────────

apps/desktop/src/lib/settings/sections/DriveIndexingSection.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
6262
onMount(() => {
6363
void refreshDbSize()
64-
// Refresh DB size every 5 seconds while visible
65-
refreshTimer = setInterval(() => void refreshDbSize(), 5000)
64+
// Refresh DB size every 2 seconds while visible
65+
refreshTimer = setInterval(() => void refreshDbSize(), 2000)
6666
6767
return () => {
6868
clearInterval(refreshTimer)

0 commit comments

Comments
 (0)