Remove gRPC
All checks were successful
Build and Test / account (push) Successful in 6m16s

RNEX is already in a working state
This commit is contained in:
red binder 2026-04-27 18:26:24 +02:00
commit 893bcecc9e
6 changed files with 0 additions and 158 deletions

View file

@ -20,8 +20,6 @@ mod account;
mod error;
mod dsresponse;
mod data_wrapper;
// #[deprecated]
mod grpc;
mod graphql;
mod email;
mod mii_util;
@ -29,37 +27,6 @@ mod json_api;
type Pool = sqlx::Pool<Postgres>;
async fn start_grpc(){
let act_database_url = env::var("DATABASE_URL").expect("account database url is not set");
let pool = PgPoolOptions::new()
.max_connections(5)
.connect(&act_database_url)
.await
.expect("unable to create pool");
let grpc_instance = grpc::AccountService(pool);
let addr: SocketAddr =
SocketAddr::from((
env::var("ROCKET_ADDRESS").ok()
.map(|v| v.parse().expect("unable to read address"))
.unwrap_or(IpAddr::V4(Ipv4Addr::LOCALHOST)),
7071
)
);
tokio::spawn(async move{
Server::builder()
.add_service(grpc::grpc::account_server::AccountServer::new(grpc_instance))
.serve(addr)
.await
.expect("unable to start grpc server");
});
}
#[catch(404)]
fn not_found(_req: &Request) -> (Status, (ContentType, RawXml<&'static str>)) {
@ -85,8 +52,6 @@ fn not_found(_req: &Request) -> (Status, (ContentType, RawXml<&'static str>)) {
async fn launch() -> _ {
dotenv().ok();
start_grpc().await;
let act_database_url = env::var("DATABASE_URL").expect("account database url is not set");
let pool = PgPoolOptions::new()