MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / probe_ready

Method probe_ready

xtask/src/main.rs:3453–3470  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

3451 }
3452
3453 async fn probe_ready(&self) -> Result<()> {
3454 let mut config = tokio_postgres::Config::new();
3455 configure_native_postgres_client(&mut config, self);
3456 let (client, connection) = config
3457 .connect(tokio_postgres::NoTls)
3458 .await
3459 .context("connect readiness probe")?;
3460 let connection_task = tokio::spawn(async move {
3461 let _ = connection.await;
3462 });
3463 let query_result = client
3464 .simple_query("SELECT 1")
3465 .await
3466 .context("run readiness probe query");
3467 drop(client);
3468 connection_task.abort();
3469 query_result.map(|_| ())
3470 }
3471}
3472
3473fn configure_native_postgres_client(config: &mut tokio_postgres::Config, native: &NativePostgres) {

Callers 1

wait_readyMethod · 0.80

Calls 1

Tested by

no test coverage detected