File tree 3 files changed +7
-4
lines changed
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -972,3 +972,8 @@ pub static ALLOW_STORAGE_GET_VIA_DOCUMENT_ID: LazyLock<bool> =
972
972
/// See https://docs.rs/tower-http/0.5.0/tower_http/timeout/struct.TimeoutLayer.html
973
973
pub static HTTP_SERVER_TIMEOUT_DURATION : LazyLock < Duration > =
974
974
LazyLock :: new ( || Duration :: from_secs ( env_config ( "HTTP_SERVER_TIMEOUT_SECONDS" , 300 ) ) ) ;
975
+
976
+ /// The limit on the request size to /push_config.
977
+ // Schema and code bundle pushes must be less than this.
978
+ pub static MAX_PUSH_BYTES : LazyLock < usize > =
979
+ LazyLock :: new ( || env_config ( "MAX_PUSH_BYTES" , 100_000_000 ) ) ;
Original file line number Diff line number Diff line change @@ -88,8 +88,6 @@ pub mod subs;
88
88
mod test_helpers;
89
89
90
90
pub const MAX_CONCURRENT_REQUESTS : usize = 128 ;
91
- // Schema and code bundle pushes must be less than this in 100MB
92
- pub const MAX_PUSH_BYTES : usize = 100_000_000 ;
93
91
94
92
pub struct LocalAppState {
95
93
// Origin for the server (e.g. http://127.0.0.1:3210, https://demo.convex.cloud)
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ use common::{
18
18
knobs:: {
19
19
MAX_BACKEND_ACTION_CALLBACKS_REQUEST_SIZE ,
20
20
MAX_BACKEND_PUBLIC_API_REQUEST_SIZE ,
21
+ MAX_PUSH_BYTES ,
21
22
} ,
22
23
} ;
23
24
use http:: {
@@ -109,7 +110,6 @@ use crate::{
109
110
sync_client_version_url,
110
111
} ,
111
112
LocalAppState ,
112
- MAX_PUSH_BYTES ,
113
113
} ;
114
114
115
115
pub async fn router ( st : LocalAppState ) -> Router {
@@ -142,7 +142,7 @@ pub async fn router(st: LocalAppState) -> Router {
142
142
StatusCode :: INTERNAL_SERVER_ERROR
143
143
} ) )
144
144
. layer ( RequestDecompressionLayer :: new ( ) )
145
- . layer ( DefaultBodyLimit :: max ( MAX_PUSH_BYTES ) ) ,
145
+ . layer ( DefaultBodyLimit :: max ( * MAX_PUSH_BYTES ) ) ,
146
146
)
147
147
. route ( "/get_config" , post ( get_config) )
148
148
. route ( "/get_config_hashes" , post ( get_config_hashes) )
You can’t perform that action at this time.
0 commit comments