Skip to content

Commit

Permalink
ROVER-279 Make variable names clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanrainer committed Jan 15, 2025
1 parent 410d39d commit f61a812
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions src/composition/runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,26 +175,29 @@ where
{
/// Runs the [`Runner`]
pub fn run(self) -> BoxStream<'static, CompositionEvent> {
let (supergraph_config_stream, supergraph_config_stream_2, supergraph_config_subtask) =
if let Some(supergraph_config_watcher) = self.state.supergraph_config_watcher {
tracing::info!("Watching subgraphs for changes...");
let (supergraph_config_stream, supergraph_config_subtask) =
BroadcastSubtask::new(supergraph_config_watcher);
(
supergraph_config_stream.boxed(),
supergraph_config_subtask.subscribe().boxed(),
Some(supergraph_config_subtask),
)
} else {
tracing::warn!(
let (
supergraph_config_stream_for_subtask_watcher,
supergraph_config_stream_for_federation_watcher,
supergraph_config_subtask,
) = if let Some(supergraph_config_watcher) = self.state.supergraph_config_watcher {
tracing::info!("Watching subgraphs for changes...");
let (supergraph_config_stream, supergraph_config_subtask) =
BroadcastSubtask::new(supergraph_config_watcher);
(
supergraph_config_stream.boxed(),
supergraph_config_subtask.subscribe().boxed(),
Some(supergraph_config_subtask),
)
} else {
tracing::warn!(
"No supergraph config detected, changes to subgraph configurations will not be applied automatically"
);
(
tokio_stream::empty().boxed(),
tokio_stream::empty().boxed(),
None,
)
};
(
tokio_stream::empty().boxed(),
tokio_stream::empty().boxed(),
None,
)
};

let (subgraph_change_stream, subgraph_watcher_subtask) =
Subtask::new(self.state.subgraph_watchers);
Expand All @@ -210,7 +213,7 @@ where

// Start subgraph watchers, listening for events from the supergraph change stream.
subgraph_watcher_subtask.run(
supergraph_config_stream
supergraph_config_stream_for_subtask_watcher
.filter_map(|recv_res| async move {
match recv_res {
Ok(res) => Some(res),
Expand All @@ -224,7 +227,7 @@ where
);

federation_watcher_subtask.run(
supergraph_config_stream_2
supergraph_config_stream_for_federation_watcher
.filter_map(|recv_res| async move {
match recv_res {
Ok(res) => Some(res),
Expand Down

0 comments on commit f61a812

Please sign in to comment.