@@ -1173,6 +1173,9 @@ pub struct Processing {
11731173 /// Maximum rate limit to report to clients.
11741174 #[ serde( default = "default_max_rate_limit" ) ]
11751175 pub max_rate_limit : Option < u32 > ,
1176+ /// Configuration for attachment uploads.
1177+ #[ serde( default ) ]
1178+ pub upload : UploadServiceConfig ,
11761179}
11771180
11781181impl Default for Processing {
@@ -1191,6 +1194,7 @@ impl Default for Processing {
11911194 attachment_chunk_size : default_chunk_size ( ) ,
11921195 projectconfig_cache_prefix : default_projectconfig_cache_prefix ( ) ,
11931196 max_rate_limit : default_max_rate_limit ( ) ,
1197+ upload : UploadServiceConfig :: default ( ) ,
11941198 }
11951199 }
11961200}
@@ -1239,6 +1243,26 @@ impl Default for OutcomeAggregatorConfig {
12391243 }
12401244}
12411245
1246+ /// Configuration values for attachment uploads.
1247+ #[ derive( Serialize , Deserialize , Debug ) ]
1248+ #[ serde( default ) ]
1249+ pub struct UploadServiceConfig {
1250+ /// Maximum concurrency of uploads.
1251+ pub max_concurrent_requests : usize ,
1252+
1253+ /// Maximum duration of an attachment upload in seconds. Uploads that take longer are discarded.
1254+ pub timeout : u64 ,
1255+ }
1256+
1257+ impl Default for UploadServiceConfig {
1258+ fn default ( ) -> Self {
1259+ Self {
1260+ max_concurrent_requests : 100 ,
1261+ timeout : 60 ,
1262+ }
1263+ }
1264+ }
1265+
12421266/// Determines how to emit outcomes.
12431267/// For compatibility reasons, this can either be true, false or AsClientReports
12441268#[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
@@ -2493,6 +2517,11 @@ impl Config {
24932517 & self . values . processing . topics . unused
24942518 }
24952519
2520+ /// Configuration of the attachment upload service.
2521+ pub fn upload ( & self ) -> & UploadServiceConfig {
2522+ & self . values . processing . upload
2523+ }
2524+
24962525 /// Redis servers to connect to for project configs, cardinality limits,
24972526 /// rate limiting, and metrics metadata.
24982527 pub fn redis ( & self ) -> Option < RedisConfigsRef < ' _ > > {
0 commit comments