diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 940d7e5..bce6f24 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -1153,6 +1153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", + "libz-sys", "miniz_oxide", ] @@ -1786,6 +1787,17 @@ version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +[[package]] +name = "libz-sys" +version = "1.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -2907,6 +2919,12 @@ dependencies = [ "serde", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.5" diff --git a/backend/Cargo.toml b/backend/Cargo.toml index ef6e734..2ab4c49 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -8,16 +8,16 @@ actix-web = "4" actix-cors = "0.7.0" mongodb = "3.1.0" aws-sdk-s3 = { version = "1.65.0" } -tokio = { version = "1", features = ["full"] } -anyhow = "1.0.94" +tokio = { version = "1", features = ["rt"] } +anyhow = { version = "1.0.40", default-features = false } serde = { version = "1.0.215", features = ["derive"] } -flate2 = "1.0.35" -chrono = "0.4.39" +flate2 = { version = "1.0.19", features = ["zlib"] } +chrono = { version = "0.4.19", features = ["serde"] } rand = "0.8.5" -log = "0.4.22" futures-util = "0.3.31" aws-credential-types = { version = "1.2.1", features = ["hardcoded-credentials"] } env_logger = "0.11.5" +log = "0.4.22" [[bin]] name = "backend" diff --git a/backend/src/delete_service.rs b/backend/src/delete_service.rs index 55ffef2..8f59397 100644 --- a/backend/src/delete_service.rs +++ b/backend/src/delete_service.rs @@ -2,9 +2,9 @@ use std::sync::Arc; use std::time::Duration; use chrono::Utc; use futures_util::StreamExt; -use log::{error, warn}; use tokio::spawn; use tokio::time::interval; +use log::{error, warn}; use crate::aws_service::AWSService; use crate::mongodb_service::MongoService; @@ -65,7 +65,7 @@ impl DeleteHandler { error!("Failed to delete paste from database: {:?}", err); } let id = &paste.id; - + if let Err(err) = mongo_service.delete_paste(id).await { error!("Failed to delete paste file: {}", err); } else {