Replace deterministic .index.tmp path with per-save unique temp files via tempfile::Builder. Eliminates race condition where background indexer thread and TUI main thread could collide on the same temp path, causing data truncation or corrupt cache writes. Changes: - Add write_cache_atomically() helper using tempfile::Builder - Refactor save_with_hash() and save() to use the helper - Extract encode_cache() to deduplicate serialization logic - Move tempfile from [dev-dependencies] to [dependencies] - Add 2 concurrent tests validating no corruption under parallel writes Fixes #17
25 lines
529 B
TOML
25 lines
529 B
TOML
[package]
|
|
name = "log-viewer-core"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
|
|
[dependencies]
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
thiserror.workspace = true
|
|
notify.workspace = true
|
|
toml.workspace = true
|
|
parking_lot.workspace = true
|
|
crossbeam-channel.workspace = true
|
|
regex.workspace = true
|
|
memchr.workspace = true
|
|
memmap2.workspace = true
|
|
directories.workspace = true
|
|
xxhash-rust.workspace = true
|
|
bincode.workspace = true
|
|
unicode-width.workspace = true
|
|
tempfile.workspace = true
|
|
|
|
[dev-dependencies]
|
|
insta.workspace = true
|