Skip to content

Commit 3908e8b

Browse files
committed
future
1 parent cc55684 commit 3908e8b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libs/blockscout-service-launcher/src/test_server.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn get_test_server_settings() -> (ServerSettings, Url) {
2424

2525
/// `check_health_response` - additional logic to verify if healthcheck
2626
/// was successful. `true` - success
27-
pub async fn init_server<F, R, FCheck>(
27+
pub async fn init_server<F, R, FCheck, RCheck>(
2828
run: F,
2929
base: &Url,
3030
healthcheck_timeout: Option<Duration>,
@@ -33,7 +33,8 @@ pub async fn init_server<F, R, FCheck>(
3333
where
3434
F: FnOnce() -> R + Send + 'static,
3535
R: Future<Output = Result<(), anyhow::Error>> + Send,
36-
FCheck: Fn(reqwest::Response) -> bool,
36+
FCheck: Fn(reqwest::Response) -> RCheck + Send + 'static,
37+
RCheck: Future<Output = bool> + Send,
3738
{
3839
let server_handle = tokio::spawn(async move { run().await });
3940

@@ -50,7 +51,7 @@ where
5051
{
5152
if response.status() == reqwest::StatusCode::OK {
5253
if let Some(check_health_response) = &check_health_response {
53-
if check_health_response(response) {
54+
if check_health_response(response).await {
5455
break;
5556
}
5657
} else {

0 commit comments

Comments
 (0)