aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.rs
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2024-10-03 12:43:19 +0200
committerJan Tuomi <jan@jantuomi.fi>2024-10-03 12:43:19 +0200
commit68bd2441247a5785378c9e90c5dc0ce7330e23b5 (patch)
tree656e8ab09bfc90fd1ad46795ec3cd04562db0b6f /src/common.rs
parent08ec17df328afcf310805313c65c1947feb5d6d9 (diff)
Add exclusive lock request file to prioritize writes
Diffstat (limited to 'src/common.rs')
-rw-r--r--src/common.rs7
1 files changed, 5 insertions, 2 deletions
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';