remove parking_lot (#2350)
This commit is contained in:
parent
67a34adf4b
commit
e33736ae47
6 changed files with 9 additions and 11 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -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",
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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!();
|
||||
|
|
Loading…
Reference in a new issue