Skip to content

Commit eb5c595

Browse files
committed
refactor: update new_watcher implemented in subgraph monitor
1 parent 50550e9 commit eb5c595

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

common/src/subgraph_client/client.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,12 @@ impl DeploymentClient {
152152
Some((deployment, url)) => Some(
153153
monitor_deployment_status(deployment, url)
154154
.await
155-
.expect(&format!(
156-
"Failed to initialize monitoring for deployment {deployment}"
157-
)),
155+
.unwrap_or_else(|_| {
156+
panic!(
157+
"Failed to initialize monitoring for deployment `{}`",
158+
deployment
159+
)
160+
}),
158161
),
159162
None => None,
160163
},

common/src/subgraph_client/monitor.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ pub async fn monitor_deployment_status(
4141
status_url: Url,
4242
) -> anyhow::Result<Receiver<DeploymentStatus>> {
4343
new_watcher(Duration::from_secs(30), move || {
44-
let status_url = status_url.clone();
45-
async move { check_deployment_status(deployment, status_url).await }
44+
check_deployment_status(deployment, status_url.clone())
4645
})
4746
.await
4847
}

0 commit comments

Comments
 (0)