mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 09:10:14 +00:00
chore: cargo fmt
This commit is contained in:
parent
c8b6dc4c23
commit
299be27031
4 changed files with 8 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ use axum::{
|
||||||
middleware::{FromFnLayer, Next},
|
middleware::{FromFnLayer, Next},
|
||||||
response::Response,
|
response::Response,
|
||||||
};
|
};
|
||||||
use fred::{clients::RedisPool, prelude::LuaInterface, util::sha1_hash, interfaces::ClientLike};
|
use fred::{clients::RedisPool, interfaces::ClientLike, prelude::LuaInterface, util::sha1_hash};
|
||||||
use metrics::counter;
|
use metrics::counter;
|
||||||
use tracing::{debug, error, info, warn};
|
use tracing::{debug, error, info, warn};
|
||||||
|
|
||||||
|
|
@ -45,7 +45,10 @@ pub fn ratelimiter<F, T>(f: F) -> FromFnLayer<F, Option<RedisPool>, T> {
|
||||||
let rscript = r.clone();
|
let rscript = r.clone();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
if let Ok(()) = rscript.wait_for_connect().await {
|
if let Ok(()) = rscript.wait_for_connect().await {
|
||||||
match rscript.script_load::<String, String>(LUA_SCRIPT.to_string()).await {
|
match rscript
|
||||||
|
.script_load::<String, String>(LUA_SCRIPT.to_string())
|
||||||
|
.await
|
||||||
|
{
|
||||||
Ok(_) => info!("connected to redis for request rate limiting"),
|
Ok(_) => info!("connected to redis for request rate limiting"),
|
||||||
Err(err) => error!("could not load redis script: {}", err),
|
Err(err) => error!("could not load redis script: {}", err),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use fred::{
|
use fred::{
|
||||||
|
clients::RedisPool,
|
||||||
error::RedisError,
|
error::RedisError,
|
||||||
interfaces::KeysInterface,
|
interfaces::KeysInterface,
|
||||||
clients::RedisPool,
|
|
||||||
types::{Expiration, SetOptions},
|
types::{Expiration, SetOptions},
|
||||||
};
|
};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use fred::{interfaces::HashesInterface, clients::RedisPool};
|
use fred::{clients::RedisPool, interfaces::HashesInterface};
|
||||||
use prost::Message;
|
use prost::Message;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
use twilight_gateway::Event;
|
use twilight_gateway::Event;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use chrono::Timelike;
|
use chrono::Timelike;
|
||||||
use fred::{interfaces::*, clients::RedisPool};
|
use fred::{clients::RedisPool, interfaces::*};
|
||||||
use signal_hook::{
|
use signal_hook::{
|
||||||
consts::{SIGINT, SIGTERM},
|
consts::{SIGINT, SIGTERM},
|
||||||
iterator::Signals,
|
iterator::Signals,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue