added cache, s3 to taskmanager, ask cache if result is the same, among others
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use axum::Router;
|
||||
use cache::ClientLike;
|
||||
use config::config;
|
||||
use fred::prelude::*;
|
||||
use sqlx::postgres::PgPoolOptions;
|
||||
use std::fs::File;
|
||||
use std::sync::Arc;
|
||||
@@ -8,7 +8,7 @@ use std::time::Duration;
|
||||
use tokio::net::TcpListener;
|
||||
use tokio::signal;
|
||||
use tokio::sync::Mutex;
|
||||
use tower_governor::{governor::GovernorConfigBuilder, GovernorLayer};
|
||||
// use tower_governor::{governor::GovernorConfigBuilder, GovernorLayer};
|
||||
use tower_http::{
|
||||
cors::{Any, CorsLayer},
|
||||
trace::{self, TraceLayer},
|
||||
@@ -101,13 +101,13 @@ async fn main() {
|
||||
.expect("Failed to connect to database");
|
||||
|
||||
let pool_size = 8;
|
||||
let config = Config::from_url(&redis_url).unwrap(); // TODO: fix the unwrap <<<
|
||||
let config = cache::Config::from_url(&redis_url).unwrap(); // TODO: fix the unwrap <<<
|
||||
|
||||
let redis_pool = Builder::from_config(config)
|
||||
let redis_pool = cache::Builder::from_config(config)
|
||||
.with_performance_config(|config| {
|
||||
config.default_command_timeout = Duration::from_secs(60);
|
||||
})
|
||||
.set_policy(ReconnectPolicy::new_exponential(0, 100, 30_000, 2))
|
||||
.set_policy(cache::ReconnectPolicy::new_exponential(0, 100, 30_000, 2))
|
||||
.build_pool(pool_size)
|
||||
.expect("Failed to create cache pool");
|
||||
|
||||
|
Reference in New Issue
Block a user