RNEX is already in a working state
This commit is contained in:
parent
c0fdc1445d
commit
893bcecc9e
6 changed files with 0 additions and 158 deletions
35
src/main.rs
35
src/main.rs
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue