Fix syncing when network latency is present (#4)
* WIP * Add debug * Dedupe inserts * Add deterministic ordering * Fix whitespaces * Update insta * Add integration test script * Rename * Add test * Working for non-deletes * omg it mostly works for deletes * Isdeleted fix * remove created dates * update api * Take document id * No max attempt * works * Use string uuids * . * working!!!! (hopefully) * Improve bundling * Add module * lint * . * lint * Fix CI * use toolchain * clean up * Add useSlowFileEvents * Delete fuzz * Fix CI * use docker * fix script * clean up * Clean up * change node version * Build docker image on every commit * fix ci * 1 db per vault * Add scritps folder * Bump versions * Lint * . * Fix tests for real * Style * . * try * Consistent ordering * Fix tests * hmm * . * Clean up diff * Fixes * . * Fix version bump * . * . * .
This commit is contained in:
parent
bcf48c428d
commit
8b8f1d91d9
91 changed files with 2252 additions and 1586 deletions
|
|
@ -1,31 +1,33 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use log::debug;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::consts::{DEFAULT_MAX_CONNECTIONS, DEFAULT_SQLITE_URL};
|
||||
use crate::consts::{DEFAULT_DATABASES_DIRECTORY_PATH, DEFAULT_MAX_CONNECTIONS};
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
||||
pub struct DatabaseConfig {
|
||||
#[serde(default = "default_sqlite_url")]
|
||||
pub sqlite_url: String,
|
||||
#[serde(default = "default_databases_directory_path")]
|
||||
pub databases_directory_path: PathBuf,
|
||||
|
||||
#[serde(default = "default_max_connections")]
|
||||
pub max_connections: u32,
|
||||
}
|
||||
|
||||
fn default_sqlite_url() -> String {
|
||||
debug!("Using default sqlite url: {}", DEFAULT_SQLITE_URL);
|
||||
DEFAULT_SQLITE_URL.to_owned()
|
||||
fn default_databases_directory_path() -> PathBuf {
|
||||
debug!("Using default databases directory path: {DEFAULT_DATABASES_DIRECTORY_PATH:?}");
|
||||
PathBuf::from(DEFAULT_DATABASES_DIRECTORY_PATH)
|
||||
}
|
||||
|
||||
fn default_max_connections() -> u32 {
|
||||
debug!("Using default max connections: {}", DEFAULT_MAX_CONNECTIONS);
|
||||
debug!("Using default max connections: {DEFAULT_MAX_CONNECTIONS}");
|
||||
DEFAULT_MAX_CONNECTIONS
|
||||
}
|
||||
|
||||
impl Default for DatabaseConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
sqlite_url: default_sqlite_url(),
|
||||
databases_directory_path: default_databases_directory_path(),
|
||||
max_connections: default_max_connections(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,20 +15,17 @@ pub struct ServerConfig {
|
|||
}
|
||||
|
||||
fn default_host() -> String {
|
||||
debug!("Using default server host: {}", DEFAULT_HOST);
|
||||
debug!("Using default server host: {DEFAULT_HOST}");
|
||||
DEFAULT_HOST.to_owned()
|
||||
}
|
||||
|
||||
fn default_port() -> u16 {
|
||||
debug!("Using default server port: {}", DEFAULT_PORT);
|
||||
debug!("Using default server port: {DEFAULT_PORT}");
|
||||
DEFAULT_PORT
|
||||
}
|
||||
|
||||
fn default_max_body_size_mb() -> usize {
|
||||
debug!(
|
||||
"Using default max body size (MB): {}",
|
||||
DEFAULT_MAX_BODY_SIZE_MB
|
||||
);
|
||||
debug!("Using default max body size (MB): {DEFAULT_MAX_BODY_SIZE_MB}");
|
||||
DEFAULT_MAX_BODY_SIZE_MB
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue