Skip to content

Commit

Permalink
fix: only use local-client if deployment_id is defined
Browse files Browse the repository at this point in the history
Signed-off-by: Gustavo Inacio <[email protected]>
  • Loading branch information
gusinacio committed Oct 30, 2024
1 parent 1e52f82 commit 2f34d9f
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions common/src/indexer_service/http/indexer_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,23 @@ impl IndexerService {

let network_subgraph: &'static SubgraphClient = Box::leak(Box::new(SubgraphClient::new(
http_client.clone(),
Some(DeploymentDetails {
deployment: options.config.subgraphs.network.config.deployment_id,
status_url: Some(options.config.graph_node.status_url.clone()),
query_url: options.config.graph_node.query_url.clone(),
query_auth_token: options.config.service.free_query_auth_token.clone(),
}),
options
.config
.subgraphs
.network
.config
.deployment_id
.map(|deployment| {
DeploymentDetails::for_graph_node_url(
options.config.graph_node.status_url.clone(),
options.config.graph_node.query_url.clone(),
deployment,
)
})
.transpose()
.expect(
"Failed to parse graph node query endpoint and network subgraph deployment",
),
DeploymentDetails::for_query_url_with_token(
options.config.subgraphs.network.config.query_url.as_ref(),
options
Expand Down Expand Up @@ -260,12 +271,23 @@ impl IndexerService {

let escrow_subgraph: &'static SubgraphClient = Box::leak(Box::new(SubgraphClient::new(
http_client,
Some(DeploymentDetails {
deployment: options.config.subgraphs.escrow.config.deployment_id,
status_url: Some(options.config.graph_node.status_url.clone()),
query_url: options.config.graph_node.query_url.clone(),
query_auth_token: options.config.service.free_query_auth_token.clone(),
}),
options
.config
.subgraphs
.escrow
.config
.deployment_id
.map(|deployment| {
DeploymentDetails::for_graph_node_url(
options.config.graph_node.status_url.clone(),
options.config.graph_node.query_url.clone(),
deployment,
)
})
.transpose()
.expect(
"Failed to parse graph node query endpoint and escrow subgraph deployment",
),
DeploymentDetails::for_query_url_with_token(
options.config.subgraphs.escrow.config.query_url.as_ref(),
options
Expand Down

0 comments on commit 2f34d9f

Please sign in to comment.