Skip to content

Commit

Permalink
fix(be): Use fair mutex to syncronise multiple consumers writing to s…
Browse files Browse the repository at this point in the history
…qlite
  • Loading branch information
andrewinci committed Nov 4, 2022
1 parent f91a7a9 commit b95b2b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src-tauri/src/lib/record_store/app_store.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::lib::{types::ParsedKafkaRecord, Error, Result};
use parking_lot::{lock_api::Mutex, FairMutex};
use parking_lot::{FairMutex};
use rusqlite::{named_params, Connection};
use std::sync::Arc;

Expand All @@ -10,7 +10,7 @@ pub struct AppStore {
impl AppStore {
pub fn new() -> Self {
AppStore {
conn: Arc::new(Mutex::new(
conn: Arc::new(FairMutex::new(
Connection::open_in_memory().expect("Unable to initialize the in memory sqlite DB"),
)),
}
Expand Down

0 comments on commit b95b2b2

Please sign in to comment.