feat(settings): add "Rebuild semantic index" maintenance action
Drops and recreates the sqlite-vec tables at the current model dimension, then re-queues every image for embedding. Fixes "dimension mismatch" search errors that occur when the vector table was built for a different model/dimension (e.g. after experimenting with 768-dim models against this 512-dim build). The rebuild runs under the embedding worker's DB write lock and resets the job queue inside a single transaction, so it can't interleave with an in-flight embedding batch (per code review).
This commit is contained in:
@@ -1288,7 +1288,7 @@ fn max_worker_fetch_size(active_folders: &HashSet<i64>) -> usize {
|
||||
.unwrap_or(StorageProfile::Balanced.worker_fetch_size())
|
||||
}
|
||||
|
||||
fn with_db_write_lock<T>(operation: impl FnOnce() -> Result<T>) -> Result<T> {
|
||||
pub fn with_db_write_lock<T>(operation: impl FnOnce() -> Result<T>) -> Result<T> {
|
||||
let lock = DB_WRITE_LOCK.get_or_init(|| Mutex::new(()));
|
||||
let _guard = lock.lock().unwrap();
|
||||
operation()
|
||||
|
||||
Reference in New Issue
Block a user