Retry insight persistence with exponential backoff to avoid SQLite lock contention
Add retry_with_backoff utility (100ms base, ±25% jitter, 3 attempts) and replace all 11 direct DAO calls in insight_chat.rs and insight_generator.rs. The Mutex guard drops between retries so the maintenance connection can release its SQLite write lock.
This commit is contained in:
1 parent
4029625dc0
commit
38aaddfd2a
4 files changed
+133
-58
No files matched your search
@@ -192,7 +192,7 @@ pub struct ImageExif {
|
||||
pub clip_model_version: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[derive(Insertable, Clone)]
|
||||
#[diesel(table_name = photo_insights)]
|
||||
pub struct InsertPhotoInsight {
|
||||
pub library_id: i32,
|
||||
|
||||
Reference in new issue
Block a user