]> Untitled Git - lemmy.git/commitdiff
remove parking_lot (#2350)
authorLuna <46259660+LunaticHacker@users.noreply.github.com>
Mon, 11 Jul 2022 17:12:12 +0000 (22:42 +0530)
committerGitHub <noreply@github.com>
Mon, 11 Jul 2022 17:12:12 +0000 (17:12 +0000)
Cargo.lock
Cargo.toml
crates/apub/Cargo.toml
crates/apub/src/objects/mod.rs
crates/utils/src/rate_limit/mod.rs
src/main.rs

index 800aa024054397b3407ffd557f2241e759723a2d..d6cbfbdddbe1ac1a0e695dd27e4dd4fee8697b3a 100644 (file)
@@ -1961,7 +1961,6 @@ dependencies = [
  "lemmy_utils",
  "lemmy_websocket",
  "once_cell",
- "parking_lot 0.12.0",
  "reqwest",
  "reqwest-middleware",
  "serde",
@@ -2076,7 +2075,6 @@ dependencies = [
  "lemmy_websocket",
  "opentelemetry 0.17.0",
  "opentelemetry-otlp",
- "parking_lot 0.12.0",
  "reqwest",
  "reqwest-middleware",
  "reqwest-retry",
index c3d52425a76a46b3e833b30d7396e80a43ffdf3a..407a19ee719149a24ef0a5c542691a294674741d 100644 (file)
@@ -60,7 +60,6 @@ reqwest-middleware = "0.1.5"
 reqwest-tracing = "0.2.1"
 clokwerk = "0.3.5"
 doku = "0.11.0"
-parking_lot = "0.12.0"
 reqwest-retry = "0.1.5"
 console-subscriber = { version = "0.1.3", optional = true }
 opentelemetry = { version = "0.17.0", features = ["rt-tokio"], optional = true }
index 7e8e952814dd76022d5187bda24c1c3907ed3e91..2714eb8bd7a4fc045906d81eb244a6e1632f3ef7 100644 (file)
@@ -44,7 +44,6 @@ anyhow = "1.0.56"
 reqwest = { version = "0.11.10", features = ["json"] }
 html2md = "0.2.13"
 once_cell = "1.10.0"
-parking_lot = "0.12.0"
 
 [dev-dependencies]
 serial_test = "0.6.0"
index 7293fc3645121865a60b432e338d73fe49ee3885..8f11f03b18e2bd62f5e8730463a962c69a460ea5 100644 (file)
@@ -71,10 +71,9 @@ pub(crate) mod tests {
     settings::SETTINGS,
   };
   use lemmy_websocket::{chat_server::ChatServer, LemmyContext};
-  use parking_lot::Mutex;
   use reqwest::{Client, Request, Response};
   use reqwest_middleware::{ClientBuilder, Middleware, Next};
-  use std::sync::Arc;
+  use std::sync::{Arc, Mutex};
   use task_local_extensions::Extensions;
 
   struct BlockedMiddleware;
index f8acc3aff76d985e39c5c94c4d4e1894a22942ac..79bdbb1d8fd5dc393a386f33f5744dc95ae361d6 100644 (file)
@@ -4,13 +4,12 @@ use actix_web::{
   HttpResponse,
 };
 use futures::future::{ok, Ready};
-use parking_lot::Mutex;
 use rate_limiter::{RateLimitType, RateLimiter};
 use std::{
   future::Future,
   pin::Pin,
   rc::Rc,
-  sync::Arc,
+  sync::{Arc, Mutex},
   task::{Context, Poll},
 };
 
@@ -85,7 +84,7 @@ impl RateLimited {
       RateLimitType::Comment => (rate_limit.comment, rate_limit.comment_per_second),
       RateLimitType::Search => (rate_limit.search, rate_limit.search_per_second),
     };
-    let mut limiter = self.rate_limiter.lock();
+    let mut limiter = self.rate_limiter.lock().expect("mutex poison error");
 
     limiter.check_rate_limit_full(self.type_, &ip_addr, kind, interval)
   }
index 3fc3bbc455f383e50e4927ee8dc029b77f393064..fa771c3dececb84cd155c5d21aa5b26635aa8470 100644 (file)
@@ -29,12 +29,16 @@ use lemmy_utils::{
   settings::{structs::Settings, SETTINGS},
 };
 use lemmy_websocket::{chat_server::ChatServer, LemmyContext};
-use parking_lot::Mutex;
 use reqwest::Client;
 use reqwest_middleware::ClientBuilder;
 use reqwest_retry::{policies::ExponentialBackoff, RetryTransientMiddleware};
 use reqwest_tracing::TracingMiddleware;
-use std::{env, sync::Arc, thread, time::Duration};
+use std::{
+  env,
+  sync::{Arc, Mutex},
+  thread,
+  time::Duration,
+};
 use tracing_actix_web::TracingLogger;
 
 embed_migrations!();