mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
fix: set journal_compression to None
This commit is contained in:
Generated
+4
-4
@@ -1527,9 +1527,9 @@ checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fjall"
|
name = "fjall"
|
||||||
version = "3.1.2"
|
version = "3.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1a9530ff159bc3ad3a15da746da0f6e95375c2ac64708cbb85ec1ebd26761a84"
|
checksum = "fdf46551c9abc5fb0e0d540da36c875197285af2a29833892d7d3434b8617343"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder-lite",
|
"byteorder-lite",
|
||||||
"byteview",
|
"byteview",
|
||||||
@@ -2737,9 +2737,9 @@ checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lsm-tree"
|
name = "lsm-tree"
|
||||||
version = "3.1.2"
|
version = "3.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9d67f95fd716870329c30aaeedf87f23d426564e6ce46efa045a91444faf2a19"
|
checksum = "f38ed727e0965f218f4e419231b9ecacc1db8fb5066cf1df0d2bafeef88459d4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder-lite",
|
"byteorder-lite",
|
||||||
"bytes 1.11.1",
|
"bytes 1.11.1",
|
||||||
|
|||||||
+1
-1
@@ -122,7 +122,7 @@ rcgen = "0.14.7"
|
|||||||
rustls-pemfile = "2.2.0"
|
rustls-pemfile = "2.2.0"
|
||||||
blake3 = "1.8.4"
|
blake3 = "1.8.4"
|
||||||
uuid = { version = "1.23.0", features = ["v4", "serde"] }
|
uuid = { version = "1.23.0", features = ["v4", "serde"] }
|
||||||
fjall = { version = "3.1.2", features = ["lz4", "metrics", "bytes_1"] }
|
fjall = { version = "3.1.3", features = ["lz4", "metrics", "bytes_1"] }
|
||||||
tantivy = { version = "0.26.0", features = ["zstd-compression"] }
|
tantivy = { version = "0.26.0", features = ["zstd-compression"] }
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
#bincode = "1.3.3"
|
#bincode = "1.3.3"
|
||||||
|
|||||||
@@ -57,18 +57,17 @@ impl BlobManager {
|
|||||||
|
|
||||||
fn process_detached_email(
|
fn process_detached_email(
|
||||||
eml: DetachedEmail,
|
eml: DetachedEmail,
|
||||||
store: &Database,
|
|
||||||
email_ks: &Keyspace,
|
email_ks: &Keyspace,
|
||||||
attach_ks: &Keyspace,
|
attach_ks: &Keyspace,
|
||||||
) {
|
) {
|
||||||
let (email_hash, email_data) = eml.email;
|
let (email_hash, email_data) = eml.email;
|
||||||
let mut batch = store.batch();
|
|
||||||
let mut needs_commit = false;
|
|
||||||
|
|
||||||
match email_ks.contains_key(&email_hash) {
|
match email_ks.contains_key(&email_hash) {
|
||||||
Ok(false) => {
|
Ok(false) => {
|
||||||
batch.insert(email_ks, email_hash.as_bytes(), email_data);
|
if let Err(e) = email_ks.insert(email_hash, email_data) {
|
||||||
needs_commit = true;
|
tracing::error!("CRITICAL: Failed to insert email: {:?}", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Err(e) => tracing::error!("Fjall email_ks error: {:?}", e),
|
Err(e) => tracing::error!("Fjall email_ks error: {:?}", e),
|
||||||
_ => {}
|
_ => {}
|
||||||
@@ -78,29 +77,27 @@ impl BlobManager {
|
|||||||
for (a_hash, a_data) in attachments {
|
for (a_hash, a_data) in attachments {
|
||||||
match attach_ks.contains_key(&a_hash) {
|
match attach_ks.contains_key(&a_hash) {
|
||||||
Ok(false) => {
|
Ok(false) => {
|
||||||
batch.insert(attach_ks, a_hash.as_bytes(), a_data);
|
if let Err(e) = attach_ks.insert(a_hash, a_data) {
|
||||||
needs_commit = true;
|
tracing::error!("CRITICAL: Failed to insert attachment: {:?}", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Err(e) => tracing::error!("Fjall attach_ks error: {:?}", e),
|
Err(e) => tracing::error!("Fjall attach_ks error: {:?}", e),
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if needs_commit {
|
|
||||||
if let Err(e) = batch.commit() {
|
|
||||||
tracing::error!("Fjall Batch Commit Error: {:?}", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let db = Database::builder(&DATA_DIR_MANAGER.eml_dir)
|
let db = Database::builder(&DATA_DIR_MANAGER.eml_dir)
|
||||||
.cache_size(64 * 1024 * 1024)
|
.cache_size(64 * 1024 * 1024)
|
||||||
.max_cached_files(Some(400))
|
.max_cached_files(Some(400))
|
||||||
.max_journaling_size(256 * 1024 * 1024)
|
.journal_compression(CompressionType::None)
|
||||||
|
.max_journaling_size(64 * 1024 * 1024)
|
||||||
.open()
|
.open()
|
||||||
.expect("Failed to initialize Fjall database: Check if the directory exists and has write permissions.");
|
.expect("Failed to initialize Fjall database: Check if the directory exists and has write permissions.");
|
||||||
|
|
||||||
|
|
||||||
let email_keyspace = db
|
let email_keyspace = db
|
||||||
.keyspace("email", || {
|
.keyspace("email", || {
|
||||||
KeyspaceCreateOptions::default()
|
KeyspaceCreateOptions::default()
|
||||||
@@ -111,15 +108,15 @@ impl BlobManager {
|
|||||||
)
|
)
|
||||||
.with_kv_separation(Some(
|
.with_kv_separation(Some(
|
||||||
KvSeparationOptions::default()
|
KvSeparationOptions::default()
|
||||||
.separation_threshold(0)
|
.separation_threshold(1024)
|
||||||
.compression(CompressionType::Lz4)
|
.compression(CompressionType::Lz4)
|
||||||
.file_target_size(128 * 1024 * 1024)
|
.file_target_size(512 * 1024 * 1024)
|
||||||
.staleness_threshold(0.5)
|
.staleness_threshold(0.5)
|
||||||
.age_cutoff(0.6),
|
.age_cutoff(0.6),
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
.expect("Failed to open 'email' keyspace: The partition metadata might be corrupted or inaccessible.");
|
.expect("Failed to open 'email' keyspace: The partition metadata might be corrupted or inaccessible.");
|
||||||
|
|
||||||
let attachments_keyspace = db
|
let attachments_keyspace = db
|
||||||
.keyspace("attachments", || {
|
.keyspace("attachments", || {
|
||||||
KeyspaceCreateOptions::default()
|
KeyspaceCreateOptions::default()
|
||||||
@@ -129,19 +126,18 @@ impl BlobManager {
|
|||||||
)
|
)
|
||||||
.with_kv_separation(Some(
|
.with_kv_separation(Some(
|
||||||
KvSeparationOptions::default()
|
KvSeparationOptions::default()
|
||||||
.separation_threshold(0)
|
.separation_threshold(1024)
|
||||||
.compression(CompressionType::Lz4)
|
.compression(CompressionType::Lz4)
|
||||||
.file_target_size(256 * 1024 * 1024)
|
.file_target_size(512 * 1024 * 1024)
|
||||||
.staleness_threshold(0.5)
|
.staleness_threshold(0.5)
|
||||||
.age_cutoff(0.6),
|
.age_cutoff(0.6),
|
||||||
))
|
))
|
||||||
.max_memtable_size(16 * 1024 * 1024)
|
.max_memtable_size(16 * 1024 * 1024)
|
||||||
})
|
})
|
||||||
.expect("Failed to open 'attachments' keyspace: Check disk space for blob storage initialization.");
|
.expect("Failed to open 'attachments' keyspace: Check disk space for blob storage initialization.");
|
||||||
|
|
||||||
let (sender, mut receiver) = mpsc::channel::<DetachedEmail>(100);
|
let (sender, mut receiver) = mpsc::channel::<DetachedEmail>(100);
|
||||||
|
|
||||||
let store = db.clone();
|
|
||||||
let email_ks = email_keyspace.clone();
|
let email_ks = email_keyspace.clone();
|
||||||
let attach_ks = attachments_keyspace.clone();
|
let attach_ks = attachments_keyspace.clone();
|
||||||
let handler = task::spawn(async move {
|
let handler = task::spawn(async move {
|
||||||
@@ -151,9 +147,9 @@ impl BlobManager {
|
|||||||
res = receiver.recv() => {
|
res = receiver.recv() => {
|
||||||
match res {
|
match res {
|
||||||
Some(eml) => {
|
Some(eml) => {
|
||||||
Self::process_detached_email(eml, &store, &email_ks, &attach_ks);
|
Self::process_detached_email(eml, &email_ks, &attach_ks);
|
||||||
while let Ok(next_eml) = receiver.try_recv() {
|
while let Ok(next_eml) = receiver.try_recv() {
|
||||||
Self::process_detached_email(next_eml, &store, &email_ks, &attach_ks);
|
Self::process_detached_email(next_eml, &email_ks, &attach_ks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
@@ -171,7 +167,7 @@ impl BlobManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
while let Some(eml) = receiver.recv().await {
|
while let Some(eml) = receiver.recv().await {
|
||||||
Self::process_detached_email(eml, &store, &email_ks, &attach_ks);
|
Self::process_detached_email(eml, &email_ks, &attach_ks);
|
||||||
}
|
}
|
||||||
|
|
||||||
tracing::info!("BlobManager: All remaining tasks processed. Closing Fjall.");
|
tracing::info!("BlobManager: All remaining tasks processed. Closing Fjall.");
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ export function UserProfileForm({ user }: UserProfileFormProps) {
|
|||||||
{email.charAt(0).toUpperCase()}
|
{email.charAt(0).toUpperCase()}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col min-w-0">
|
<div className="flex flex-col min-w-0">
|
||||||
<span className="text-sm font-semibold truncate">
|
<span className="text-xs font-semibold truncate">
|
||||||
{email}
|
{email}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-[10px] text-muted-foreground font-mono">
|
<span className="text-[10px] text-muted-foreground font-mono">
|
||||||
|
|||||||
Reference in New Issue
Block a user