From 68bd2441247a5785378c9e90c5dc0ce7330e23b5 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 3 Oct 2024 12:43:19 +0200 Subject: Add exclusive lock request file to prioritize writes --- src/common.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/common.rs') diff --git a/src/common.rs b/src/common.rs index 4922c73..c4fce39 100644 --- a/src/common.rs +++ b/src/common.rs @@ -2,13 +2,16 @@ use std::fs::{metadata, File}; use std::io::{self}; use std::path::PathBuf; +// For Unix-like systems #[cfg(unix)] -use std::os::unix::fs::MetadataExt; // For Unix-like systems +use std::os::unix::fs::MetadataExt; +// For Windows #[cfg(windows)] -use std::os::windows::fs::MetadataExt; // For Windows +use std::os::windows::fs::MetadataExt; pub const ACTIVE_LOG_FILENAME: &str = "db"; +pub const EXCL_LOCK_REQUEST_FILENAME: &str = "excl_lock_req"; pub const DEFAULT_READ_BUF_SIZE: usize = 1024 * 1024; // 1 MB pub const FIELD_SEPARATOR: u8 = b'\x1C'; pub const ESCAPE_CHARACTER: u8 = b'\x1D'; -- cgit v1.3