From d364cde916c089a0e9da78ac063f6b365f70d33d Mon Sep 17 00:00:00 2001 From: creating2morrow Date: Sun, 10 Dec 2023 21:29:19 -0500 Subject: [PATCH] increase server json limit for successful txset broadcast --- neveko-core/src/i2p.rs | 5 +++-- neveko-core/src/lib.rs | 1 + neveko-core/src/order.rs | 7 ++++--- src/main.rs | 5 +++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/neveko-core/src/i2p.rs b/neveko-core/src/i2p.rs index 1a69d25..4205807 100644 --- a/neveko-core/src/i2p.rs +++ b/neveko-core/src/i2p.rs @@ -100,7 +100,7 @@ async fn find_tunnels() { /// Called on application startup for i2p tunnel creation, /// -/// proxy tunnel, etc. Logs proxy status every minute. +/// proxy tunnel, etc. Logs proxy status every 10 minutes. pub async fn start() { info!("starting i2p-zero"); let args = args::Args::parse(); @@ -116,7 +116,8 @@ pub async fn start() { find_tunnels().await; { tokio::spawn(async move { - let tick: std::sync::mpsc::Receiver<()> = schedule_recv::periodic_ms(600000); + let tick: std::sync::mpsc::Receiver<()> = + schedule_recv::periodic_ms(crate::I2P_CONNECTIVITY_CHECK_INTERVAL); loop { tick.recv().unwrap(); check_connection().await; diff --git a/neveko-core/src/lib.rs b/neveko-core/src/lib.rs index 7aedb6e..feb1eb5 100644 --- a/neveko-core/src/lib.rs +++ b/neveko-core/src/lib.rs @@ -67,4 +67,5 @@ pub const I2P_ZERO_RELEASH_HASH: &str = "14f34052ad6abb0c24b048816b0ea86b696ae350dd139dd1e90a67ca88e1d07a"; pub const LMDB_MAPSIZE: u64 = 1 * 1024 * 1024 * 1024; +pub const I2P_CONNECTIVITY_CHECK_INTERVAL: u32 = 600000; // DO NOT EDIT BELOW THIS LINE diff --git a/neveko-core/src/order.rs b/neveko-core/src/order.rs index c7dde33..9780391 100644 --- a/neveko-core/src/order.rs +++ b/neveko-core/src/order.rs @@ -299,7 +299,10 @@ pub async fn trigger_nasr( let proxy = reqwest::Proxy::http(&host)?; let client = reqwest::Client::builder().proxy(proxy).build(); match client? - .post(format!("http://{}/market/nasr/{}/{}", &customer, vendor, orid)) + .post(format!( + "http://{}/market/nasr/{}/{}", + &customer, vendor, orid + )) .header("proof", jwp) .send() .await @@ -482,10 +485,8 @@ pub async fn transmit_ship_request( } } - // TODO: sor is injecting order id instead of base 32 address FIX IT! - /// Executes GET /order/retrieve/orid/signature returning the order information /// /// from the vendor. diff --git a/src/main.rs b/src/main.rs index 7a3b0af..77646e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,10 @@ extern crate rocket; use neveko::*; use neveko_core::*; +use rocket::data::{ + Limits, + ToByteUnit, +}; // The only changes below here should be mounting new controller methods #[launch] @@ -10,6 +14,7 @@ async fn rocket() -> _ { let config = rocket::Config { ident: rocket::config::Ident::none(), ip_header: None, + limits: Limits::default().limit("json", 10_i32.mebibytes()), port: utils::get_app_port(), ..rocket::Config::debug_default() };