fix sqlite database is lock issue by setting busy_timeout and wal mode

This commit is contained in:
appflowy
2021-07-19 16:15:20 +08:00
parent 06be0a562c
commit ef4c4180e2
51 changed files with 1539 additions and 700 deletions

View File

@ -22,4 +22,5 @@ phf = { version = "0.8.0", features = ["macros"] }
similar = "1.2.2"
dialoguer = "0.8.0"
toml = "0.5.8"
serde = { version = "1.0", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
pathdiff = "0.2.0"

View File

@ -78,6 +78,7 @@ fn parse_files_protobuf(proto_crate_path: &str, proto_output_dir: &str) -> Vec<P
if !enums.is_empty() || !structs.is_empty() {
let info = ProtoFile {
file_path: path.clone(),
file_name: file_name.clone(),
structs: structs.iter().map(|s| s.name.clone()).collect(),
enums: enums.iter().map(|e| e.name.clone()).collect(),

View File

@ -88,6 +88,7 @@ impl ProtobufCrate {
#[derive(Debug)]
pub struct ProtoFile {
pub file_path: String,
pub file_name: String,
pub structs: Vec<String>,
pub enums: Vec<String>,
@ -121,6 +122,7 @@ impl FlutterProtobufInfo {
model_dir
}
#[allow(dead_code)]
pub fn mod_file_path(&self) -> String {
let mod_file_path = format!("{}/protobuf.dart", self.package_path);
mod_file_path

View File

@ -154,3 +154,14 @@ where
path_and_name(path, name);
}
}
#[allow(dead_code)]
pub fn suffix_relative_to_path(path: &str, base: &str) -> String {
let base = Path::new(base);
let path = Path::new(path);
path.strip_prefix(base)
.unwrap()
.to_str()
.unwrap()
.to_owned()
}