Files
Amisha Prabhat 2a66f4a392 feat(routing): build the gRPC interface for communicating with the external service to perform elimination routing (#6672)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Chethan Rao <70657455+Chethan-rao@users.noreply.github.com>
2024-12-13 05:15:08 +00:00

28 lines
970 B
Rust

#[allow(clippy::expect_used)]
fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg(feature = "dynamic_routing")]
{
// Get the directory of the current crate
let proto_path = router_env::workspace_path().join("proto");
let success_rate_proto_file = proto_path.join("success_rate.proto");
let elimination_proto_file = proto_path.join("elimination_rate.proto");
let health_check_proto_file = proto_path.join("health_check.proto");
let out_dir = std::path::PathBuf::from(std::env::var("OUT_DIR")?);
// Compile the .proto file
tonic_build::configure()
.out_dir(out_dir)
.compile(
&[
success_rate_proto_file,
elimination_proto_file,
health_check_proto_file,
],
&[proto_path],
)
.expect("Failed to compile proto files");
}
Ok(())
}