Skip to content

Commit 0e5bf38

Browse files
committed
Compile timeout expressions during config load
1 parent a0aa887 commit 0e5bf38

File tree

1 file changed

+8
-1
lines changed
  • lib/executor/src/executors

1 file changed

+8
-1
lines changed

lib/executor/src/executors/map.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ impl SubgraphExecutorMap {
110110
None => &original_endpoint_str,
111111
};
112112

113+
let timeout_config = config
114+
.traffic_shaping
115+
.subgraphs
116+
.get(&subgraph_name)
117+
.and_then(|s| s.request_timeout.as_ref())
118+
.unwrap_or(&config.traffic_shaping.all.request_timeout);
119+
subgraph_executor_map.register_timeout_if_absent(&subgraph_name, timeout_config)?;
120+
113121
subgraph_executor_map.register_executor(&subgraph_name, endpoint_str)?;
114122
subgraph_executor_map.register_static_endpoint(&subgraph_name, endpoint_str);
115123
}
@@ -328,7 +336,6 @@ impl SubgraphExecutorMap {
328336
.clone();
329337

330338
let subgraph_config = self.resolve_subgraph_config(subgraph_name);
331-
self.register_timeout_if_absent(subgraph_name, &subgraph_config.timeout_config)?;
332339

333340
let executor = HTTPSubgraphExecutor::new(
334341
subgraph_name.to_string(),

0 commit comments

Comments
 (0)