File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,6 @@ use undermoon::broker::{
1919#[ global_allocator]
2020static ALLOC : jemallocator:: Jemalloc = jemallocator:: Jemalloc ;
2121
22- const MAX_PAYLOAD : usize = 128 * 1024 * 1024 ;
23-
2422fn gen_conf ( ) -> MemBrokerConfig {
2523 let mut s = config:: Config :: new ( ) ;
2624 if let Some ( conf_file_path) = env:: args ( ) . nth ( 1 ) {
@@ -190,8 +188,6 @@ async fn main() -> std::io::Result<()> {
190188 HttpServer :: new ( move || {
191189 let service = service. clone ( ) ;
192190 App :: new ( )
193- . data ( actix_web:: web:: PayloadConfig :: default ( ) . limit ( MAX_PAYLOAD ) )
194- . data ( actix_web:: web:: JsonConfig :: default ( ) . limit ( MAX_PAYLOAD ) )
195191 . wrap ( middleware:: Logger :: default ( ) )
196192 . configure ( |cfg| configure_app ( cfg, service. clone ( ) ) )
197193 } )
Original file line number Diff line number Diff line change @@ -23,11 +23,14 @@ use std::sync::{Arc, RwLock};
2323use std:: time:: Duration ;
2424
2525pub const MEM_BROKER_API_VERSION : & str = "/api/v2" ;
26+ const MAX_PAYLOAD : usize = 128 * 1024 * 1024 ;
2627
2728pub fn configure_app ( cfg : & mut web:: ServiceConfig , service : Arc < MemBrokerService > ) {
2829 let service2 = service. clone ( ) ;
2930 cfg. data ( service) . service (
3031 web:: scope ( MEM_BROKER_API_VERSION )
32+ . app_data ( actix_web:: web:: PayloadConfig :: default ( ) . limit ( MAX_PAYLOAD ) )
33+ . app_data ( actix_web:: web:: JsonConfig :: default ( ) . limit ( MAX_PAYLOAD ) )
3134 . wrap_fn ( move |req, srv| {
3235 let method = req. method ( ) . clone ( ) ;
3336 let peer_addr = match req. peer_addr ( ) {
You can’t perform that action at this time.
0 commit comments