From f0a96d65863aa3aa24ede9ff0bf1b372b0d30ad4 Mon Sep 17 00:00:00 2001 From: Yuki Kishimoto Date: Sat, 12 Oct 2024 08:33:10 -0300 Subject: [PATCH] Small adj. --- src/config/mod.rs | 2 +- src/config/model.rs | 4 ++-- src/main.rs | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index 8c30402..cdfd9ed 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -71,7 +71,7 @@ impl Config { }, limit: Limit { max_filters: config_file.limit.max_filters.unwrap_or(10), - max_events_per_filter: config_file.limit.max_events_per_filter.unwrap_or(100), + //max_events_per_filter: config_file.limit.max_events_per_filter.unwrap_or(100), }, nostr: Nostr { relays: config_file.nostr.relays, diff --git a/src/config/model.rs b/src/config/model.rs index 05029d6..629c2c6 100644 --- a/src/config/model.rs +++ b/src/config/model.rs @@ -22,13 +22,13 @@ pub struct ConfigFileNetwork { #[derive(Debug, Clone)] pub struct Limit { pub max_filters: usize, - pub max_events_per_filter: usize, + //pub max_events_per_filter: usize, } #[derive(Deserialize)] pub struct ConfigFileLimit { pub max_filters: Option, - pub max_events_per_filter: Option, + //pub max_events_per_filter: Option, } #[derive(Clone, Deserialize)] diff --git a/src/main.rs b/src/main.rs index 378a96c..111ce86 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ use std::time::Duration; use axum::http::Method; use axum::routing::{get, post}; use axum::Router; -use nostr_sdk::{Client, Keys, Result}; +use nostr_sdk::{Client, Result}; use redis::Client as RedisClient; use tower_http::cors::{Any, CorsLayer}; use tower_http::trace::TraceLayer; @@ -31,8 +31,7 @@ async fn main() -> Result<()> { logger::init(&config); - let keys = Keys::generate(); - let client = Client::new(&keys); + let client = Client::default(); for relay in config.nostr.relays.iter() { client.add_relay(relay).await?; @@ -41,7 +40,7 @@ async fn main() -> Result<()> { client.connect().await; let redis: Option = if config.redis.enabled { - Some(RedisClient::open("redis://127.0.0.1/")?) + Some(RedisClient::open(config.redis.endpoint.clone())?) } else { None };