Skip to content

Commit

Permalink
Small adj.
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Oct 12, 2024
1 parent 534f132 commit f0a96d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/config/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<usize>,
pub max_events_per_filter: Option<usize>,
//pub max_events_per_filter: Option<usize>,
}

#[derive(Clone, Deserialize)]
Expand Down
7 changes: 3 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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?;
Expand All @@ -41,7 +40,7 @@ async fn main() -> Result<()> {
client.connect().await;

let redis: Option<RedisClient> = if config.redis.enabled {
Some(RedisClient::open("redis://127.0.0.1/")?)
Some(RedisClient::open(config.redis.endpoint.clone())?)
} else {
None
};
Expand Down

0 comments on commit f0a96d6

Please sign in to comment.